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!
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)