I made a script that checks if a player has a gamepass that gives him access to a special feature in game, but when I do it returns "Game passes can only be queried by a Script running on a ROBLOX game server" even thought it's inside a script in the Server Script Storage, can anybody help?

if game:GetService("GamePassService"):PlayerHasPass(player, 921094225) then
		player.PlayerGui.Unlock:FireClient()
	end

5 comments

2

It'd be nice if you could paste the error

0

That was the error. "18:40:45.941 - Game passes can only be queried by a Script running on a ROBLOX game server (x3)"

0

Is this in a localscript? This can only be run from the serverside, not the client

0

No, it's a regular script inside Server Script Storage.

0

Soo there is no solution? xD