this what i have tried but it does not work:
local passId = 5778889
game.Players.PlayerAdded:connect(function()
function isAuthenticated(player)
return game:GetService("GamePassService"):PlayerHasPass(player, passId)
end
game.Players.PlayerAdded:connect(function(plr)
if isAuthenticated(plr) then
repeat wait(0.001) until game.Players.LocalPlayer.Character.Humanoid
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = game.Players.LocalPlayer.Character.Humanoid.WalkSpeed +100
end)
end)
local passId = 5778889 function isAuthenticated(player) return game:GetService(“MarketplaceService”):UserOwnsGamePassAsync(player.userId, passId) end game.Players.PlayerAdded:connect(function(plr) if isAuthenticated(plr) then repeat wait() until plr.Character plr.Character:WaitForChild("Humanoid").WalkSpeed = plr.Character.Humanoid.WalkSpeed + 100 end end)
Your issue was due to a syntax error. I removed a duplicate PlayerAdded and fixed the syntax error in your script, and it should work fine now. Also, LocalPlayer doesn't work on the server and you used it instead of the defined variable "plr". Make sure this script is inside of ServerScriptService!
Let me know if this script doesn't work down in the comments!
(You should also put a code block into your original post next time.)
Yes you can create a script to increase a player's WalkSpeed
if they own a certain game-pass.
Here is a basic script for it.
local passId = 5778889 local MarketplaceService = game:GetService("MarketplaceService")game:GetService("Players").PlayerAdded:connect(function(Player) if MarketplaceService:UserOwnsGamePassAsync(Player.UserId,passId) then --your code to increase walkspeed end end)
P.S. Do not use GamePassService
, it is deprecated.