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

Effect fades away when they buyer of my Game Pass died? [SOLVED]

Asked by 9 years ago

This is a problem which my game pass effects wont last long when the buyer died. They will get the effect when they bought the pass, but it will fade away instantly when they died

game.Players.PlayerAdded:connect(function(plr)
    if isAuthenticated(plr) then
        local name = plr.Name
        if name then
            local check = game.Workspace:FindFirstChild(name)
            if check then
                checkHumanoid = check:FindFirstChild("Humanoid")
                if checkHumanoid then
                    checkHumanoid.WalkSpeed = 16 * 2
                end
            end
        end
    end
end)

-- this do not work...
while checkHumanoid.WalkSpeed ~= 16 *2 do
    checkHumanoid.WalkSpeed = 16 *2
end

i already the Died event, still, it wont work, any answers?

1 answer

Log in to vote
0
Answered by 9 years ago

You want to use the plr.CharacterAdded event, and give them their walkspeed when they respawn after death. The reason your script isn't working is because when the player dies, their speed is set back to default when the respawn post-death.

0
Oh, ok i reworked my Game Pass script, thanks for the help! Endermanium 25 — 9y
Ad

Answer this question