The game is a freeze tag game, when I test on studio server everything works perfectly fine no delay, no bugs.
I have a collision block covering the player and welded to it, I use that for hit detection, however, when players collide the function i use to freeze/thaw people gets called more than once…
Now you’d say “use a debounce” and I am, I’m using multiple ways to denounce, having a bool set to false until the function is done being called, checking inside the function if the player is already frozen or thawed, etc… but nothing seems to work…
local canTcheck = true
collisionBlock.Touched:connect(function(h)
local pHit = game.Players:GetPlayerFromCharacter(h.Parent)
if pHit and h.Name ~= "BBall" then
if GameSettings.GameOn.Value == true then
if (char.HumanoidRootPart.Position - h.Parent.HumanoidRootPart.Position).magnitude >= 5 and canTcheck then
local isTagger = PlayerManager:Exe("get", plr.userId).Tagger
canTcheck = false
if isTagger then
if not GameSettings.FrozenList:FindFirstChild(pHit.userId) then
_G.CurMode:Exe("tag",plr,pHit)
end
else
if GameSettings.FrozenList:FindFirstChild(pHit.userId) then
_G.CurMode:Exe("tag",plr,pHit)
end
end
end
end
canTcheck = true
end
end)
The issue wasn’t my checks or denounces. in my code that handles the freezing / thawing players I tell the server that the said player is frozen after I set their stats which caused a delay.