I have this script to check if the player owns a gamepass and it works in studio but not in the actaul game, why ?
id = 1008824264 wait(10) for i,v in pairs(game.Players:GetPlayers()) do if v then if game:GetService("GamePassService"):PlayerHasPass(v,id) then wait(1) game.Players.LocalPlayer.leaderstats.Points.Value = game.Players.LocalPlayer.leaderstats.Points.Value + 250 game.Players.LocalPlayer.PlayerGui.MEGAVIPWALK.Enabled = true end end end
id = 1008824264 wait(10) for i,v in pairs(game.Players:GetPlayers()) do if game:GetService("GamePassService"):PlayerHasPass(v,id) then wait(1) v.leaderstats.Points.Value=v.leaderstats.Points.Value + 250 v.PlayerGui.MEGAVIPWALK.Enabled = true end end
Just change game.Players.LocalPlayer to v because game.Players.LocalPlayer doesn't work in server side scripts.