Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

Player should take damage when my particle is enabled, what is wrong? [Solved]

Asked by
xsodar -5
2 months ago
Edited 2 months ago

Hello again

When my particle "Steam" is enabled then the player should take damage.

The player does not take any damage for some reason, what is wrong?

script 1:

while true do

script.Parent.Steam.Enabled = true
wait(3)
script.Parent.Steam.Enabled = false
wait(3)
end

script 2:

if script.Parent.Steam.Enabled == true then

script.Parent.Dead.Touched:Connect(function(hit)

    local humanoid = hit.Parent:FindFirstChild("Humanoid")
            if humanoid ~= nil then
                humanoid.Health = humanoid.Health -10   
    end     
end)
end

The second script works without "if script.Parent.Steam.Enabled == true then" so it's something with that.

Thanks

0
Try putting the if statement in the touched event...also when you check for a humanoid like that you can put "if humanoid then" instead of "if humanoid ~= nil"...just saves on a little work ForeverBrown 71 — 2mo
0
Thanks it worked xsodar -5 — 2mo

Answer this question