Why is my AdminCheck ModuleScript not working?

What I’m Doing

So, i’m attempting to use a module script to make an admin checker.

Issues

I can’t seem to get the module to return to the script and continue as it’s supposed to.

Solutions

I don’t know any solutions on this topic as I don’t usually use Module Scripts.
I know I just use the break command to stop the script entirely but I don’t know what else to do.

What it does now

The script as of right now does the print but does not return to the normal script it’s supposed to to complete the action necessary. I get no errors but as this button is suppose to play a cutscene, I know it’s not working correctly.

Admin ModuleScript

--[Made By MillerrIAm]--
--------[Variables]-------
local player = game:GetService("Players")
---------[Admins]--------
adminIDs = {678299,4947564}
--[[UserIds in order = {"MillerrIAm","NemesisY2J"}]]
--------[Main Code]------
local adminCheck = {}

function adminCheck.Activate(plr)
		for i,Admin in ipairs (adminIDs) do
			if plr.UserId == Admin then
				print("Is an Admin")
				return
			else
				print("Is not an admin")
				break
			end
		end
	end

return adminCheck

Thank you for any help you can give me.

1 Like

When you do this line:
if adminCheck.Activate(plr) then -- Where the admin Checker is

You’re expecting something to return, this could be anything at all.

In your module however, you just call return which will return nothing, and that check will fail.

			if plr.UserId == Admin then
				print("Is an Admin")
				return true

Will fix your issue.

1 Like