Basic Admin Essensitials (Module Configures)

Hello, Developers! I have problems with my Scripts that won’t working.

function Funcs.lockSever(Args)
	local Player = Args[1]
	local Cmd = Args[2]
	if Cmd == "slock" then
		if not sysTable.serverLocked then
			sysTable.serverLocked = true
			essentialsEvent:FireAllClients(Player,'Hint','Status','Server has been locked! Please refrain from rejoining.')
			essentialsEvent:FireClient(Player,'Hint','Error','The server was already locked.')
	elseif Cmd == "unslock" then
		if sysTable.serverLocked then
			sysTable.serverLocked = false
			essentialsEvent:FireAllClients(Player,'Hint','Status','Server has been unlocked!')
			essentialsEvent:FireClient(Player,'Hint','Error','Training server was already unlocked.')

Can someone help me to fix this script?

Thank you everyone!

1 Like

do you know exactly whats not working? is there any errors? can you provide the whole script instead of the function only?

I don’t know why it doesn’t working.

I believe you are checking to see if sysTable.serverlocked is false, but syntax wise your actually checking if it doesnt exist.

Since it probably does exist, its not reading anything in that if statement.

You do not need the Player Arg on the FireAllClients