Tiny error mistake you made.
You were supposed to use UserOwnsGamePassAsync instead of PlayerOwnsAsset since that is deprecated and we are not checking an asset.
https://developer.roblox.com/en-us/api-reference/function/MarketplaceService/UserOwnsGamePassAsync
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId,10763132) then
character.Humanoid.WalkSpeed = 32
end
end)
end)
Edit: Also use player.UserId so if the player changes username you can still track if they own the gamepass. Also use game:GetService() for MarketPlace
Edit2: Ah I see what you need.
game.Players.PlayerAdded:Connect(
function(player)
player.CharacterAdded:Connect(
function(character)
local CheckIfUserOwnsGamepassThread =
coroutine.create(
function()
while wait(1) do
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, 10763132) then
character.Humanoid.WalkSpeed = 32
end
end
end
)
coroutine.resume(CheckIfUserOwnsGamepassThread)
end
)
end
)
So I have made a coroutine so you can continue after in case you wanted to add to the player added event. I have also added a while loop checking if the user owns the gamepass and it will change their Humanoid's WalkSpeed to 32.
3 comments
how can a human being be so damn fast
2x Speed
You need to use pcall instead.