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

How do i make a shop Gui only open for one person?

I want to make a shop where you buy tools but when the shop opens it opens for everyone in the server. I have made it so when you press on a green circle the shop Gui opens and you can buy tools but it opens for every player in the game. I have tried with my friend and we both get the shop Gui when only one of us steps on the circle. I really need help fixing this since my game wont work if this happens. Here is the code that i have made:

game.Workspace.ShopPart.Touched:Connect(function(hit)

if hit then

script.Parent.Shop.Frame.Visible = true

end

end)

If you have any solutions i would really appreciate it!

2 comments

0

Are you using a surface GUI?

0

No I am using a screen Gui.

1 answer

✓ Accepted answer

You aren't cloning it to the player who hit it specifically.

game.Workspace.ShopPart.Touched:Connect(function(hit)

if hit:FindFirstChild("Humanoid") then
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)

gui = script.Parent.Shop:Clone()
gui.Parent = plr.PlayerGui
gui.Frame.Visible = true

end

end)

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