Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My surfacegui button click takes 2 clicks to prompt up the localscript?

Asked by 4 years ago

So I have a surfacegui that when clicked, gives u a gui, but its taking 2 clicks, to the path there, you hit a script (The one im showingu) and I believe that this is what causes it, any help?

local GiveBack = Instance.new("RemoteEvent")
Debounce = false
GiveBack.Parent = game.ReplicatedStorage
GiveBack.Name = "GiveLitBack"
script.Parent.Touched:connect(function (hit)
 if hit.Parent and game.Players:FindFirstChild(hit.Parent.Name) and not Debounce then
 Debounce = true
      local plr = game.Players[hit.Parent.Name]
if plr.PlayerGui:WaitForChild("Tattoo2") then
      plr.PlayerGui:WaitForChild("Tattoo2"):Destroy()
GiveBack:FireClient(plr)
wait(0.5)
Debounce = false

end
 end
end)
0
Looks like we would require the local script to help you, not the script you provided. alphawolvess 1784 — 4y

Answer this question