NOTE: This script does work! I only have this error when I use a BindableEvent.
Achieve
So, what i’m doing is making an admin module system that has to be ran every single time a certain event/script is ran. This is due to exploiters ruining my game by using my own Control System against me.
Issues
The reason this happens
As you can see, I have two different scripts that are connected through a BindableEvent.
When I fire the Script #1, the #2 script doesn’t get a UserId value and ends up causing the error above which stops the script from completing entirely.
Script #1
Script #2
Solutions
I do not know any solutions to this as I do believe this to be a very unique case compared to others.
The Command
if adminCheck.Activate(plr) then
end
The Module Script
--[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("Admin Started")
return true
end
end
end
return adminCheck
Thank you for any help you can give me.