As said in the title the function will not trigger, not sure why but here we are!
Server:
local events = game:GetService('ReplicatedStorage'):FindFirstChild('LeaderboardEvents')
local getAdmin = events:FindFirstChild('CheckAdmin')
local CheckPurchases = events:FindFirstChild('GetPurchases')
getAdmin.OnServerInvoke = function(player:Player)
print(player.UserId)
if script:FindFirstChild('Admins'):FindFirstChild(player.UserId) then
return true
else
return false
end
end
Client:
local function open()
print('OPEN')
local isAdmin = getAdmin:InvokeServer(player)
if isAdmin then
mainFrame.Visible = true
controlFrame:FindFirstChild('User').Text = player.Name
end
end
gui:FindFirstChild('Open').Activated:Connect(open)