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

Something Wrong With Walkspeed Gamepass... Anyone know why?

Asked by 5 years ago

Here is my script, I don't see much wrong with it. Does anyone know why this might not be working?

game.Players.PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
        if game:GetService("GamePassService"):PlayerHasPass(player, 4583498) then
            character:WaitForChild("Humanoid").WalkSpeed = 55
        end
    end)
end)

Makes 0 sense, should be working...

1 answer

Log in to vote
1
Answered by 5 years ago
Edited 5 years ago

I've had this issue recently, it was fixed when I switched gamepassservice to marketplaceservice. The script should be fixed if you have it like this:

game:GetService("Players").PlayerAdded:Connect(function(Player)
    if MarketplaceService:UserOwnsGamePassAsync(Player.UserId, 4583498) then
        Player.CharacterAdded:Connect(function(Character)
            Character:WaitForChild("Humanoid").WalkSpeed = 55
        end)
    end
end)
0
I'll try this, thanks Sir. If it works I'll verify this answer. andyad13 74 — 5y
0
It would be better to only connect this event if they have the game pass rather than checking each time. User#5423 17 — 5y
0
I agree. Let me edit the response. SystemFormat 149 — 5y
Ad

Answer this question