I keep getting "Game passes can only be queried by a Script running on a ROBLOX game server"

here is the script:

local button = script.Parent
local player = game.Players.LocalPlayer
local id = 516571966


button.MouseButton1Down:connect(function()
	 if game:GetService("GamePassService"):PlayerHasPass(player, id) then 
	if button.Parent.ColorFrame == false then
	button.Parent.ColorFrame.Visible = true
	
	
	end
	end
			
end)

5 comments

0

Doesn't help. This is a gui.

0

Do you have FE on?

0

FE?

0

Filtering enabled. GUIs can not be edited from the server and game passes can only be used on the server, so you have to use a remote event or a remote function to communicate between the server and client.