I’m doing a damage you block over time but I need the player to not be able to jump and I get an attempt to index nil with ‘JumpPower’, what do I do?
my code here:
local accion = "false"
script.Parent.Touched:Connect(function(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
humanoid.JumpPower = 0
accion = "true"
while true do
wait(1)
if accion == "true" then
humanoid:TakeDamage(0.4)
end
end
end)
script.Parent.TouchEnded:Connect(function(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
humanoid.JumpPower = 0
accion = "false"
wait(1)
accion = "true"
end)
script.Parent.Touched:Connect(function(h)
local d = h.Parent:FindFirstChild("Humanoid")
if d then
d.JumpPower = 0
end
end)
local action = false
script.Parent.Touched:Connect(function(hit)
local Humanoid = hit.Parent:FindFirstChild("Humanoid")
if Humanoid then
action = true
while true do
wait(1)
if action then
Humanoid:TakeDamage(0.4)
end
end
end
end)
script.Parent.Touched:Connect(function(hit)
local Humanoid = hit.Parent:FindFirstChild("Humanoid")
if Humanoid then
Humanoid.JumpPower = 0
action = true
end
end)
script.Parent.TouchEnded:Connect(function(hit)
local Humanoid = hit.Parent:FindFirstChild("Humanoid")
if Humanoid then
Humanoid.JumpPower = 50
action = false
end
end)