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

How would I do a function that happens when a player respawn?

Asked by 8 years ago
function check(plr)
    return game:GetService("MarketplaceService"):PlayerOwnsAsset(plr, 268673512)
end

game.Players.PlayerAdded:connect(function(player)
    if check(player) then
        player.CharacterAdded:connect(function(character)
            character.Humanoid.Walkspeed = 25
        end)
    end
end)

I don't get why this doesn't work. I'm not very good at scripting so ya. Can anyone explain to me why this doesn't work? I'm trying to make it so that when a person respawn with a gamepass it gives the person speed.

Answer this question