I was trying to check if a player has a game pass when they click a gui,but the problem is that i can only check that on roblox server side. Is there some way to check it other then when a player enters?
Module script
local module = {}
local HatPackOne = 223106881
local HatPackTwo = 2
function Authin(player,Pack)
return game:GetService("GamePassService"):PlayerHasPass(player,Pack)
end
module.Auth1 = function(player)
Authin(player,HatPackOne)
end
return module
Script in a gui
local P = game.Players.LocalPlayer
local HatPackOne = 223106881
local HatPackTwo = 2
local Auth = require(game.Workspace.Folder.CheckPass)
function Auth1(Player)
return game:GetService("GamePassService"):PlayerHasPass(Player,HatPackOne)
end
function Auth2(Player)
return game:GetService("GamePassService"):PlayerHasPass(Player,HatPackTwo)
end
script.Parent.MouseButton1Click:connect(function()
if Auth.Auth1(P) then
print("Player has the pack! Omg! Im so rich!")
end
end)

2 comments
Workspace.Script:7: attempt to call field 'hasPackOne' (a nil value)
Edited