Remote function not triggering

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)

Your script has nothing wrong with it, it is probably something silly like a script being in the wrong place, set to the wrong mode, or using the wrong Remote.

I figured it out! There is a while loop before the code and thats why its not running!
Whoops

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.