This is in a localscript, this is also my first time actually making a gamepass, i never actually cared for it in the past, so if anyone can help me it'd be great, i am having problems with it:
local pewdiepass = 599082309 local gpserv = game:GetService("GamePassService") if gpserv:PlayerHasPass(plr, pewdiepass) then subs.Value = subs.Value +785 money.Value = money.Value +1250 end
this is the error code:
Game passes can only be queried by a Script running on a ROBLOX game server
You're going to want to run this on the server, as opposed to the client, so put this in a server script. Also, you never defined "plr", "subs", or "money" and it'd be much easier if you used a .PlayerAdded function
local passId = 599082309 local gps = game:GetService('GamePassService') game.Players.PlayerAdded:connect(function(player) local subs --Define this here local money --Define this here if gps:PlayerHasPass(player, passId) then subs.Value = subs.Value + 785 money.Value = money.Value + 1250 end end)