I’m working on some sort of panel and auth system right now for fun however I got a problem: every time I run the remote event there’s a error.
Error:
ServerScriptService.Yit.Engine:4: attempt to index nil with 'Yit'
Code:
local settings = require(game:GetService("ServerScriptService").Yit.Settings)
game:GetService("ReplicatedStorage").YitRemotes.checkAuth.OnServerEvent:Connect(function(auth,plr)
local AC = plr.PlayerGui.Yit.AccessCheck
AC.Visible = true
plr.PlayerGui.Yit.AuthFrame.Visible = false
task.wait(2)
if auth == settings.AuthCode then
AC.AuthCode.status.Text = "🟢 Passed"
AC.AuthCode.status.TextColor3 = Color3.fromRGB(55, 255, 0)
else
AC.AuthCode.status.Text = "🔴 Failed"
AC.AuthCode.status.TextColor3 = Color3.fromRGB(255, 0, 0)
end
task.wait(2)
if not table.find(settings.Admins, plr.UserId) then
AC.AdminPermCheck.status.Text = "🔴 Failed"
AC.AdminPermCheck.status.TextColor3 = Color3.fromRGB(255, 0, 0)
elseif table.find(settings.Admins, plr.UserId) then
AC.AdminPermCheck.status.Text = "🟢 Passed"
AC.AdminPermCheck.status.TextColor3 = Color3.fromRGB(55, 255, 0)
task.wait(2)
if plr.AccountAge >= 60 then
AC.AccountCheck.status.Text = "🟢 Passed"
AC.AccountCheck.status.TextColor3 = Color3.fromRGB(55, 255, 0)
else
AC.AccountCheck.status.Text = "🔴 Failed"
AC.AccountCheck.status.TextColor3 = Color3.fromRGB(255, 0, 0)
end
if AC.AccountCheck.status.Text == "🔴 Failed" or AC.AdminPermCheck.status.Text == "🔴 Failed" or AC.AuthCode.status.Text == "🔴 Failed" then
AC.result.Text = "Access Result: Failed"
AC.result.TextColor3 = Color3.fromRGB(255, 0, 4)
task.wait(2)
AC.Visible = false
plr.PlayerGui.AuthFrame.Visible = true
else
AC.result.Text = "Access Result: Passed"
AC.result.TextColor3 = Color3.fromRGB(55, 255, 0)
AC.Visible = false
task.wait(3)
-- show AP
end
end
end)