So basically the AoeSphere is a part in workspace that if you touch you only get damaged once but heres my script the problem is i am getting damaged not once but twice does anyone know whats wrong with the script I put wait(99) also this all happens under 6 seconds or so no I did not wait(99) seconds to get damaged again also I have a game.Debris:addItem in another line so thats impossible does anyone have a solution
debounce = false AoeSphere.Touched:Connect(function(touch) if debounce == true then return end if debounce == false then Hum = touch.Parent:FindFirstChild('Humanoid') if Hum then Hum:TakeDamage(20) debounce = true wait(99) debounce = false end end end)
Hi i used your script in roblox studio it worked fine and it only damaged me once
debounce=false AoeSphere=game.Workspace.AoeSphere AoeSphere.Touched:Connect(function(touch) if debounce==true then return end if debounce==false then local Hum=touch.Parent:FindFirstChild("Humanoid") if Hum then Hum:TakeDamage(20) debounce=true wait(99) debounce=false end end end)
Maybe something else is affecting it make another server script and put this code inside of it. Sry for bad english