Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do you make a part open a gui when touched but only for the player that stepped on it?

In my game when you touch a part it opens the gui but when you step on the part it opens on all players screens in the server.Help me.

Heres my script:

game.Workspace.ShopBuilding2.ShopPart.Touched:Connect(function(hit) if hit then script.Parent.Shop.Frame.Visible = true end end)

1 answer

✓ Accepted answer

Put the script and the ScreenGui on the part, then put this on the script:

script.Parent.Touched:Connect(function(hit)
	local player = game.Players:GetPlayerFromCharacter(hit.Parent)
	script.Parent.Gui:Clone().Parent = player.PlayerGui
end)

Accept the answer if it worked!

This discussion is preserved as it was. New answers, comments, and votes are closed.