I'm trying to make a shop and I put an invisible part infront of the shop so once a player stands on it, it will show the GUI and once they step off it will close the GUI. However my code doesn't even open the GUI and I'm not sure what the problem is.
I'm new to Roblox coding so im not sure how to make this happen. Here's my LocalScript code:
local GunShopFrame = script.Parent
GunShopFrame.Visible = false
workspace.openPart.Touched:Connect(function()
GunShopFrame.Visible = true
end)
workspace.closePart1.Touched:Connect(function()
GunShopFrame.Visible = false
end)
workspace.closePart2.Touched:Connect(function()
GunShopFrame.Visible = false
end)
workspace.closePart3.Touched:Connect(function()
GunShopFrame.Visible = false
end)

3 comments
Is this a LocalScript?
Yes, sorry I should've put that in my question.
Don't worry about it. I figured that out, anyway.