I was trying to make a walkspeed gamepass, but it did not work for some reason, is it because of FE on?
Here is the script [it's in ServerScriptService]
game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) if game.MarketplaceService:PlayerOwnsAsset(player, 4865295) then character.Humanoid.Walkspeed = 40 end end) end)
please someon help!
Here, your problem is: You used PlayerOwnsAsset
instead of using UserOwnsGamePassAsync
. Also consider using :GetService().
Here's the code:
game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, 4865295) then character:WaitForChild("Humanoid").WalkSpeed = 40 end end) end)
The gamepass would be fine as it is a script inserted by the server, FE does not allow changes to be made by the client, however this is server-sided, so it should work fine. I'm not the best in Studio, though, so you might have to look at some one else for confirmation. If I helped, please make sure to upvote! It helps me out. -Doge Master
You should use UserOwnsGamePassASync because if you use asset id, you mean like models, decals, shirts, etc.