local reason = string.sub(txt, #p[2]+7, #txt)
This is a line from my ban command (and kick and bc)
This line is also meant to take a reason but if I wont add anything but just say @ban then this will show up:
1
2
3
4
2
3
4
LUA ERROR: sys/lua/sp-rp-script/admin.lua:88: attempt to get length of field '?' (a nil value) -> sys/lua/sp-rp-script/admin.lua:88: in function 'ParseAdminCommand' -> sys/lua/sp-rp-script/main.lua:221: in function <sys/lua/sp-rp-script/main.lua:210> -> in Lua hook 'say', params: 1, '@ban'
So I need to make the command return an error which I did but it doesn't work because of the reason thing.
If you need more parts of the code you can ask, actually I'll just place it all here!
But it would be nice if you tell me how to do it by myself because I think this isn't the last time I'll have this error