Alright, this is what I had.
AddStickTool("[DarkRP] Toggle Lockdown", {
Description = "Turns lockdown on and off.",
Icon = "icon16/lock.png",
CanTarget = anything,
OnRun = function(Player, Target)
if GetGlobalBool("DarkRP_LockDown") then
SetGlobalBool("DarkRP_LockDown", false)
DarkRP.notifyAll(0, 3, DarkRP.getPhrase("lockdown_ended"))
DarkRP.printMessageAll(HUD_PRINTTALK, DarkRP.getPhrase("lockdown_ended"))
else
SetGlobalBool("DarkRP_LockDown", true)
DarkRP.notifyAll(0, 3, DarkRP.getPhrase("lockdown_started"))
DarkRP.printMessageAll(HUD_PRINTTALK, DarkRP.getPhrase("lockdown_started"))
for k, v in pairs (player.GetAll()) do
v:ConCommand("play npc/overwatch/cityvoice/f_confirmcivilstatus_1_spkr.wav\n")
end
end
end
})
I added the line below printMessageAll and it gives me the ) expected near <eof>
AddStickTool("[DarkRP] Toggle Lockdown", {
Description = "Turns lockdown on and off.",
Icon = "icon16/lock.png",
CanTarget = anything,
OnRun = function(Player, Target)
if GetGlobalBool("DarkRP_LockDown") then
SetGlobalBool("DarkRP_LockDown", false)
DarkRP.notifyAll(0, 3, DarkRP.getPhrase("lockdown_ended"))
DarkRP.printMessageAll(HUD_PRINTTALK, DarkRP.getPhrase("lockdown_ended"))
else
SetGlobalBool("DarkRP_LockDown", true)
DarkRP.notifyAll(0, 3, DarkRP.getPhrase("lockdown_started"))
DarkRP.printMessageAll(HUD_PRINTTALK, DarkRP.getPhrase("lockdown_started"))
draw.DrawNonParsedText("lockdown_started", "ScoreboardSubtitle", chbxX, chboxY + chatBoxSize, Color(cin * 255, 0, 255 - (cin * 255), 255), TEXT_ALIGN_LEFT)
for k, v in pairs (player.GetAll()) do
v:ConCommand("play npc/overwatch/cityvoice/f_confirmcivilstatus_1_spkr.wav\n")
end
end
end
})
This proves my code is fine and it's being screwed up somehow. The drawing also didn't work and it didn't run any code past that line (the sound)
I then remove that entire line to revert to the perfectly working code before, and it gives me the same error. I bet 99% if I restart the server there will be no more error. But if I edit the code and have it refresh, error, no matter what.