local sp = script.Parent local db = true local Azarth = script.Parent.Option sp.Touched:connect(function(hit) if hit and hit.Parent:findFirstChild("Humanoid") and db then db = false local player = game.Players:GetPlayerFromCharacter(hit.Parent) if not player.PlayerGui:findFirstChild("Option") then Azarth:Clone().Parent = player.PlayerGui end wait() db = true end end)
I have no clue where to put RemoteEvents for this one, it works once but when I reset the GUI wont clone again.
Your script must be a Local Script, so this would be the modified code:
sp = script.Parent db = true Azarth = script.Parent.Option player = game.Players.LocalPlayer sp.Touched:connect(function(hit) if hit and hit.Parent:findFirstChild("Humanoid") and db then db = false if not player.PlayerGui:findFirstChild("Option") then Azarth:Clone().Parent = player.PlayerGui end wait() db = true end end)
I had begun scripting a year ago graduating from C# and I'm still not used to it, but I believe that that would be your code.