local MegaVipGamepassId = 0 -- Gamepass Id game.Players.PlayerAdded:connect(function(Player) Player:WaitForDataReady() if game:GetService("GamePassService"):PlayerHasPass(Player, MegaVipGamepassId) then coroutine.resume(coroutine.create(function() while wait() do repeat wait() until Player.Character ~= nil Player.Character.Humanoid.WalkSpeed = 32 end end)) end end)
I'm getting this error:
Humanoid is not a valid member of Model Script 'ServerScriptService.Script', Line 9 Stack End
I suggest you don't use loops, they're very inefficient
An alternative to using loops would be just checking everytime their character adds - with a CharacterAdded event. This will also eliminate the problem of having to rejoin when you buy the pass.
local passId = 0 -- Gamepass Id local speed = 32 --The speed to add game.Players.PlayerAdded:connect(function(Player) plr.CharacterAdded:connect(function(char) if game:GetService("GamePassService"):PlayerHasPass(Player, passId) then repeat wait() until char:FindFirstChild('Humanoid') ~= nil char.Humanoid.WalkSpeed = speed end end) end)