Hello, I am currently creating a game with rounds and whenever a round has started, the player can walk towards a door and touch it and a team GUI will pop up. But sometimes when you touch the door, it’s not working. I have seen this issue in some other Roblox games as well before so I don’t know if it’s because of my code or if it has to do something with Roblox. Can anyone tell me if it’s my code and if so what I need to change?
I have tried to find a solution on the internet, but I couldn’t find anything about this.
This is the code:
local debounce = false local InRound = game.ReplicatedStorage.RoundSystemValues.InRound game.Workspace.TeleportationFolder.TeamChoose.Touched:Connect(function(hit) if InRound.Value == true then if not debounce then debounce = true if game.Players:GetPlayerFromCharacter(hit.Parent) then game.ReplicatedStorage.EventsFolder.ShowGUI:FireClient(game.Players:GetPlayerFromCharacter(hit.Parent)) end wait(2) debounce = false end end end)