ME and my friend made a simulator and we have made a proper sell button and shop button and the GUIs, but the shop GUI does not come up when touched here is the code so you can take a look at it:
game.Workspace.ShopPart.Touched:Connect(function(hit) if hit then script.Parent.Shop.Frame.Visible = true end end)
Hey there,
First off it's important to keep in mind that if you have multiple parts that can be touched this won't work. You should add an onTouched script into the part itsself if this is the case.
Second off, you can't make a gui visible from the server, you should try to clone the gui into the playerGui. This, in turn, is something you can do with the GetPlayerFromCharacter() command. In the end your script should look something like this (although you may need to edit it a bit).
local taken = false script.Parent.Touched:Connect(function(hit) if hit then if part.Parent:FindFirstChild("Humanoid") then local plr = players:GetPlayerFromCharacter(part.Parent) if taken == false then taken = true game.ReplicatedStorage.Gui:FindFirstChild("Shop"):Clone().Parent = plr.PlayerGui end end end)
If this helped, please accept it as your answer. If it didn't - feel free to ask away! ^^