So, I used this to make a GUI open by a part touch, but when I tested it in studio it worked, in game.. It worked when I touched it while I was alone in the server, but when I told someone to join the part didn't open to GUI for me, or the other person...!
debounce = false GUIopen = script.Parent.Value function onTouched(hit) local plr = game.Players:GetPlayerFromCharacter(hit.Parent) if plr and debounce == false then if GUIopen.Value == false then debounce = true GUIopen.Value = true wait(0.1) plr:WaitForChild("PlayerGui").TeleportMenu.Background.Visible = false debounce = false end end end script.Parent.Touched:connect(onTouched
Help please D:
Ok I finally found out what your error was, The error was the use of Debounces, Here is the fixed Code:
debounce=false function onTouched(hit) local plr = game.Players:GetPlayerFromCharacter(hit.Parent) wait(0.1) if not debounce then debounce=true plr.PlayerGui.TeleportMenu.Background.Visible = false end debounce=false end script.Parent.Touched:connect(onTouched)
I edited it a bit, I changed the Postitions of the Debounces, If there are any errors just comment below.
Note: I had removed the BoolValue