local part = game.Workspace:WaitForChild("OpenShopPart") local player = game.Players.LocalPlayer local Character = player.Character local Debounce=false part.Touched:Connect(function(hit) if hit.Parent == Character and Debounce == false then script.Parent.ShopGui.Frame.Visible = true Debounce = true wait(2) Debounce= false end end)
Can you make another video like this, but add to the script (or whatever it's called) that when a player stands on the part, the ScreenGui shop appears and a sound effect plays? Please 🙂
local part = game.Workspace.OpenShopPart local player = game.Players.LocalPlayer local Character = player.Character part.Touched:Connect(function(hit) if hit.Parent == Character then script.Parent.ShopGui.Frame.Visible = true end end)
if anyone is having problems with the openshopscript heres mine local part = game.Workspace.OpenShopPart local player = game.Players.LocalPlayer local character = player.Character part.Touched:Connect(function(hit) if hit.Parent == character then script.Parent.ShopGui.Frame.Visible = true end end)
here ' s my code : local part = game.Workspace.OpenShopPart local player = game.Players.LocalPlayer local Character = player.Character part.Touched:Connect(function(hit) if hit.Parent == Character then script.Parent.ShopGui.Frame.Visible = true end end)
@@LetsGoPotato8 it is because you are saying If the part that hit the openpart is the character model. But what is actually touching the part can be the players leg or arm. So instead of typing: If hit.Parent == Character Do: If hit.Parent:FindFirstChild("Humanoid")
You have to put the exit button inside of the frame and then say in the script: script.Parent.Parent.Visible = false The exit button closes because you might be refering to the exit button instead of the frame. Hope this helps! :)
it doesnt work this is my script, O is my part name btw local part = game.Workspace.O local player = game.Players.LocalPlayer local Character = player.Character local Debounce = false part.Touched:Connect(function(hit) if hit.Parent == Character then script.Parent.ShopGui:WaitForChild("Frame") wait(0,2) Debounce = false end end)
First thing is if you made it a local script. It cant be a normal script because then the script cant find the player. So it has to be a local script. The other this is that you should change if hit.Parent == character to if hit.Parent:FindFirstChild("Humanoid") Hope this helps!👍
Is the any errors in the output tab? If you don't know how to open output just go to: View > Output. If there isn't any errors then it has to be the IF statement. Check that you hav not spelled "Humanoid" wrong! Hope this helps!
@@hugge6267 thanks, this helped loads, output said OpenShopPart wasn't a valid member of workspace, but I don't know why this is a problem because the name is the exact same as in the script
local part = game.Workspace:WaitForChild("OpenShopPart")
local player = game.Players.LocalPlayer
local Character = player.Character
local Debounce=false
part.Touched:Connect(function(hit)
if hit.Parent == Character and Debounce == false then
script.Parent.ShopGui.Frame.Visible = true
Debounce = true
wait(2)
Debounce= false
end
end)
bro is a legend
I searched for so long for a good Tutorial, thank you so much
Thank you so much this worked so well and your tut was great! keep up the good work :D
You are so good scripter
keep going man
I just combinded this with one off my other scripts and it worked
Great video! Thanks
I have been searching on TH-cam for this tutorial
Can you make another video like this, but add to the script (or whatever it's called) that when a player stands on the part, the ScreenGui shop appears and a sound effect plays? Please 🙂
local part = game.Workspace.OpenShopPart
local player = game.Players.LocalPlayer
local Character = player.Character
part.Touched:Connect(function(hit)
if hit.Parent == Character then
script.Parent.ShopGui.Frame.Visible = true
end
end)
Still Works Amazing Script Thanks :D
thank you so much for the tutorial
if anyone is having problems with the openshopscript heres mine
local part = game.Workspace.OpenShopPart
local player = game.Players.LocalPlayer
local character = player.Character
part.Touched:Connect(function(hit)
if hit.Parent == character then
script.Parent.ShopGui.Frame.Visible = true
end
end)
Well it doesn't work
you might have not named all the parts properly@@bexsblocks
I did that already and mine isn’t working
Could you help me do it because it completely isn’t working and I’ve done everything right
THANKS BUDDDD
I love you so much thanks
for some reason whenever I close the shop with the x button from the first script it only closes the button and not the frame...Why?
how to i add items in it so other people could buy them
nice bro
ls help problem is: OpenShopPart is not a valid member of Workspace "Workspace" was red on output i have same name in script as in workspace
Same im having the same issue
try replace game.Workspace.OpenShopPart with game.Workspace:WaitForChild("OpenShopPart") instead
then your OpenShopPart isnt added to the workspace but within a folder or model, make sure the part is standing alone in the workspace
very helpful😃
W
Nioce
what are the eqals signs?
Quando eu toco na part só parece uma fez e so
Cool thx
BROO TYSM
I did the exact same thing but it dosent work for me, any ideas ?
here ' s my code :
local part = game.Workspace.OpenShopPart
local player = game.Players.LocalPlayer
local Character = player.Character
part.Touched:Connect(function(hit)
if hit.Parent == Character then
script.Parent.ShopGui.Frame.Visible = true
end
end)
@@LetsGoPotato8 try replace game.Workspace.OpenShopPart with game.Workspace:WaitForChild("OpenShopPart") instead
@@LetsGoPotato8 it is because you are saying If the part that hit the openpart is the character model. But what is actually touching the part can be the players leg or arm. So instead of typing: If hit.Parent == Character
Do: If hit.Parent:FindFirstChild("Humanoid")
@@hugge6267 ty !
Do you know how to make it so you can get items from it?
it doesnt work. pls help i named every part right i typed everything right but it still doesnt work. help.
um when i did the first script mine didnt close the frame but it closed the x button, how can i fix?
You have to put the exit button inside of the frame and then say in the script: script.Parent.Parent.Visible = false
The exit button closes because you might be refering to the exit button instead of the frame. Hope this helps! :)
Oh ok thanks
When I try to test the part to see if the shop opens it nothing happens and I did everything correct..
the frame don't disapear when i click the X
local closeButton = script.Parent -- Przycisk zamknięcia sklepu
local shopFrame = closeButton.Parent -- Ramka sklepu
closeButton.MouseButton1Click:Connect(function()
shopFrame.Visible = false
end)
the first localscript wont work pls help
thanks🤧🤧🤧🤧🤧🤧🤧😭😭😭😭😭
how do i add items in the shop??
Error “OpenShopPart is not a valid member of workspace”
You need the same name of the open part in workspace as the one in the script
OpenShopPart is not a valid member of Workspace "Workspace" - Client - OpenShop:1
did you name the part "OpenShopPart"
im having trouble with the exit button can you help me
or send me the code
script.parent.MouseButton1Click:connect(function()
script.Parent.visible=false
end) is my script
@@Fidelgaming You need to make parent a capital P so: Parent
"Connect" must have a capital C and "Visible" must also have a capital V
When i test join the game the shop is there when i load in.
You need to turn the visibility off before you test. Hope it helps!
Dude the exit button doesn’t work
it doesnt work this is my script, O is my part name btw
local part = game.Workspace.O
local player = game.Players.LocalPlayer
local Character = player.Character
local Debounce = false
part.Touched:Connect(function(hit)
if hit.Parent == Character then
script.Parent.ShopGui:WaitForChild("Frame")
wait(0,2)
Debounce = false
end
end)
First thing is if you made it a local script. It cant be a normal script because then the script cant find the player. So it has to be a local script. The other this is that you should change if hit.Parent == character to if hit.Parent:FindFirstChild("Humanoid") Hope this helps!👍
I think its because in your wait(0,2) you cant have a comma, you need a dot. For example: wait(0.2)
its opening for all players
Make the script a local script
Bruh whenever I join the shop is open already pls help me
@@The_Rocco_Recker go to the frame and then properties, then go to visibility and turn it off. Hope this helps!
@@hugge6267 thx but i alr did another tutorial
Can u make a video on how to make it where when u touch a part a code rewards gui opens and works?
@@The_Rocco_Recker im not home rn but thanks for the idea!
does it work with a union??
Yes
i did every step but mine doesnt close, any fixes?
Make sure that you have put the local script inside of the exit button and that you haven't spelled anything wrong inside of the script.
how do i add items bruh
help me for the X button pls :(
Frame is not a valid member of ScreenGui "Players.IchBin_IB.PlayerGui.ShopGui" the is the red on output
Same
Try to change script.Parent.ShopGui.Frame to: script.Parent.ShopGui:WatForChild("Frame")
it doesn't work
doesnt work
It isn’t working
Ye I tried as well, it doesn't seem to be working
Ik
it works
dead ah
u named something wrong or didnt debug some stuff u had to debug some things
Do you have discord
Yea
@@hugge6267 what is the servers code
something to do with the shop open script isn't working for me, when i hit ShopOpenPart in game
nothing happens
Is the any errors in the output tab? If you don't know how to open output just go to: View > Output.
If there isn't any errors then it has to be the IF statement. Check that you hav not spelled "Humanoid" wrong!
Hope this helps!
@@hugge6267 thanks, this helped loads, output said OpenShopPart wasn't a valid member of workspace, but I don't know why this is a problem because the name is the exact same as in the script
nope :(
@@hugge6267