01 | admins = { |
02 | [ "tjtorin" ] = true |
03 | } |
04 | prefix = ":" |
05 |
06 | function newCmd(plr,msg,name,code) |
07 | if admins [ plr.Name ] then |
08 | if msg = = prefix..name then |
09 | spawn(code()) |
10 | end |
11 | end |
12 | end |
13 |
14 | -- FUNCTIONS |
15 | ------------------------ |
Simple. All you have to do is switch the parameters. There is no way to avoid running the kill
function if you're going to include the function as an argument. Instead, do this:
01 | admins = { |
02 | [ "tjtorin" ] = true |
03 | } |
04 | prefix = ":" |
05 |
06 | function newCmd(player,msg,name,code) |
07 | if admins [ player.Name ] then |
08 | if msg = = prefix..name then |
09 | spawn(code(player)) -- place arguments inside here, AFTER the checks are made. |
10 | end |
11 | end |
12 | end |
13 |
14 | -- FUNCTIONS |
15 | ------------------------ |