Lemme correct some errors.
function keydown()
if ( mouseon == 0 ) then
ActivateMouse()
else
DeactivateMouse()
end
end
function startup()
-- At startup, we'll bind the key.
outputChatBox( "Startup." )
bindKey( "b", "down", keydown )
outputChatBox( "Key binded." )
end
addEventHandler("onClientResourceStart", getRootElement(), startup)
function commands( commandName, arg, arg2 )
if( arg == "keydown" )
keydown()
outputChatBox( "key down." )
return
elseif( arg == "mouse" ) then
if( arg2 == "on" ) then
ActivateMouse()
outputChatBox( "Mouse activated." )
else
DeactivateMouse()
outputChatBox( "Mouse deactivated." )
end
return
else
outputChatBox( "Bomber script is active. (c) tomozj 2008" )
outputChatBox( "USAGE: /bomber [start/keydown/mouse] [on/off]" )
return
end
end
addCommandHandler("bomber", commands, arg, arg2)
All in all, you added ends before elses, which is a syntax error in Lua. Also, onClientResourceStart actually executes on resource start, (honest!) so it's redundant to have a command to execute it again.
Oh, and I didn't check to see if it actually works, it's up to you from here.