So, I want to make it so that when you step on a part a gui shop opens for you, and just for you. But when I put it in a local script, I can't make the stepped on part, and when I put it in a normal script, it opens the gui for everyone, and I don't know how to work around that. I also don't know how I can teleport the player to specific coords. Help appreciated.
For whatever part you are touching add a script like this:
local Part = script.Parent part.Touched:Connect(function(player) player.EDIT this to your gui opening end)
I used to be confused by this too, the answer is simple though. By adding player in the function parenthesis you are adding a variable for whatever touches the part, a genius move by roblox if I say so myself. However, you will quickly notice that errors will pop up in the output tab but the script still works as it should. To get around this you need to have an if statement that asks if the variable player is actually a player, like this:
local Part = script.Parent part.Touched:Connect(function(player) if player.Parent:FindFirstChild('Humanoid') then player.Edit This to Your Gui Opening end end)
Any more questions? Just Comment!
-- WolfTamer894