Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Debounce not working?

Asked by 10 years ago
coroutine.resume(coroutine.create(function()
local t = false
while wait() do 
wait()
if down == true then
repeat wait() until down == false 
stik2 = stik:Clone()
stik2.Parent = game.Workspace
stik2:BreakJoints()
stik.Transparency = 1
stik2.CFrame = CFrame.new(stik.Position)
stik2.Touched:connect(function(hit)
if hit then
vol:Destroy()
hum = hit.Parent:findFirstChild("Humanoid")
if hum and hit.Parent.Name ~= plyr.Name then
if t == false then
t = true
hum:TakeDamage(99)
t = false
end
end
end
end)

t is the debounce, i want it to do 99 damage, but it just kills.

1 answer

Log in to vote
0
Answered by 10 years ago
coroutine.resume(coroutine.create(function() 
local t = false 
while wait() do 
wait() 
if down == true then 
repeat wait() until down == false 
stik2 = stik:Clone() 
stik2.Parent = game.Workspace 
stik2:BreakJoints() 
stik.Transparency = 1 
stik2.CFrame = CFrame.new(stik.Position) 
stik2.Touched:connect(function(hit) 
if hit then 
vol:Destroy() 
hum = hit.Parent:findFirstChild("Humanoid") 
if hum and hit.Parent.Name ~= plyr.Name then 
if t == true then return end 
t = true 
hum:TakeDamage(99) 
t = false 
end  
end 
end 
end) 

Try this

0
No it didnt work. RootDirectory 10 — 10y
Ad

Answer this question