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 -7
6 days ago
Edited 6 days 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 70 — 6d
0
Thanks it worked xsodar -7 — 6d

Answer this question