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 9 years ago
01function check(plr)
02    return game:GetService("MarketplaceService"):PlayerOwnsAsset(plr, 268673512)
03end
04 
05game.Players.PlayerAdded:connect(function(player)
06    if check(player) then
07        player.CharacterAdded:connect(function(character)
08            character.Humanoid.Walkspeed = 25
09        end)
10    end
11end)

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