Ok, I am making a game, and have a GUI thats ment to open when a player walks on a part, and GUIopen is a bool value in the script.Parent.Value and it does get closed, in the GUI thats ment to open there a "Close" button that closes everything that was open and makes the GUIopen false.
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 = true
plr:WaitForChild("PlayerGui").TeleportMenu.Background.Transparency = 1
wait(0.1)
plr:WaitForChild("PlayerGui").TeleportMenu.Background.Transparency = 0.9
wait(0.1)
plr:WaitForChild("PlayerGui").TeleportMenu.Background.Transparency = 0.8
wait(0.1)
plr:WaitForChild("PlayerGui").TeleportMenu.Background.Transparency = 0.7
wait(0.1)
plr:WaitForChild("PlayerGui").TeleportMenu.Background.Transparency = 0.6
wait(0.1)
plr:WaitForChild("PlayerGui").TeleportMenu.Background.Transparency = 0.5
wait(0.1)
plr:WaitForChild("PlayerGui").TeleportMenu.Background.Transparency = 0.4
wait(0.1)
plr:WaitForChild("PlayerGui").TeleportMenu.Background.Transparency = 0.3
wait(0.1)
plr:WaitForChild("PlayerGui").TeleportMenu.Background.Transparency = 0.2
wait(0.1)
plr:WaitForChild("PlayerGui").TeleportMenu.Background.Transparency = 0.1
wait(0.05)
plr:WaitForChild("PlayerGui").TeleportMenu.Frame.Visible = true
wait(0.04)
plr:WaitForChild("PlayerGui").TeleportMenu.Frame.Title.Visible = true
wait(0.04)
plr:WaitForChild("PlayerGui").TeleportMenu.Frame.MultiPlayerButton.Visible = true
wait(0.04)
plr:WaitForChild("PlayerGui").TeleportMenu.Frame.SinglePlayerButton.Visible = true
wait(0.04)
plr:WaitForChild("PlayerGui").TeleportMenu.Frame.BossPlayerButton.Visible = true
wait(0.05)
plr:WaitForChild("PlayerGui").TeleportMenu.Frame.BackButton.Visible = true
debounce = false
end
end
end
script.Parent.Touched:connect(onTouched)
So, the script works when I test it alone in studio, but when I got someone else to test in in-game in the roblox player heres what happens, It works for me when I step on it for the first time then it worked, the I got off, then the other player tried to step on it and it didn't work, and I tried again after him and it didn't work for me too.... Then, we both left, and we joined again, and I told the player to step on the part first this time, and he said it worked, so then he got off, and I tried then it didn't work for me, then he tried getting on it again and it didn't work... D: This is too messed up for me, please help?

5 comments
But the value goes back to being false after the player closes the GUI that opened....?
And the GUIopen needs to be there anyway, because without it the script opens the GUI way to many times when the player walks on the part...
The debounce is supposed to stop the oveflow, try removing GUIopen.Value = true to test if works without it
Have you tried making a for loop? You don't need to copy and paste a ton of code.
Heh, thats my way of doing things... :P