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

how do you take away something using the died event? (SOLVED)

Asked by 9 years ago

Hey, I'm making a game and I want to know: how can you take away something using the died event? Like a walkspeed boost then take it away if they died? Thanks!

P.S Hers what I think this would be like

Local SpeedBonus = SB
Humanoid.walkSpeed.SB = 1.25
game:GetService('Players').PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
        character:WaitForChild("Humanoid").Died:connect(function()
                   Humanoid.walkspeed = 1.25
        end)
    end)
end)

I don't think it's right, but I gave it my all.

1 answer

Log in to vote
1
Answered by
Tesouro 407 Moderation Voter
9 years ago

When a character dies, the walkspeed is reset to the default, 16. What you need to do is change it when it spawns, the wiki has a script showing it.

0
You not only answerd my question, but others in the future if i have n thanks to the link, thank you a bunch! GreekGodOfMLG 244 — 9y
0
You're welcome, the wiki is always useful. Tesouro 407 — 9y
Ad

Answer this question