Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

ServerScriptService.Admin:112: attempt to index nil with 'OnServerEvent' ?

Ok so i was making an admin interface, all works well but i got this error message so my admnins command don't works

i putted a Remote Event called "Admin" in the replicated storage file

i have a normal script putted in ServerScriptService and this is what i actually scribe


AdminRE = game.ReplicatedStorage.Admin
DSS = game:GetService("DataStoreService")

AdminData = DSS:GetDataStore("Admin")
BanData = DSS:GetDataStore("Ban")
LogData = DSS:GetDataStore("Log")


-- this line under is the error


AdminRe.OnServerEvent:Connect(AdminCmd)




If u can help u are welcome i hope it's ok and everyone will understand what i mean

1 answer

✓ Accepted answer

You had a typo, it's AdminRE, not AdminRe, line 12 should be

AdminRE.OnServerEvent:Connect(AdminCmd)

You also should be using local before variables unless you are working with enviroment which i doubt.

local AdminRE = game.ReplicatedStorage.Admin
local DSS = game:GetService("DataStoreService")

local AdminData = DSS:GetDataStore("Admin")
local BanData = DSS:GetDataStore("Ban")
local LogData = DSS:GetDataStore("Log")

...

AdminRE.OnServerEvent:Connect(AdminCmd)

1 comment

0

Hooo yeah thank you didn't seen it i m gonna try thanks a lot

This discussion is preserved as it was. New answers, comments, and votes are closed.