I know this is ulx, and yes I did post over in their forums, but I thought someone here would be able to help aswell.
[code]
[ERROR] addons/ulx/lua/ulx/modules/sh/zombies.lua:69: ')' expected near 'nuke'
1. unknown - addons/ulx/lua/ulx/modules/sh/zombies.lua:0
[/code]
to my knowledge, the brackets are fine. Can anyone see what my problem is? It's causing the other 3 commands to not work either, if that helps.
[lua]----------------------------------------!spawn --------------------------------------------------
function ulx.spawn( calling_ply, target_plys )
local affected_plys = {}
for k,v in pairs(target_plys) do
if !v:Alive() then
nz.Rounds.Functions.ReSpawn(v)
table.insert(affected_plys, v)
else
ULib.tsayError( calling_ply, v:Nick() .. " is alive or spectating!", true )
end
end
ulx.fancyLogAdmin( calling_ply, "#A respawned #T", affected_plys )
end
local spawn = ulx.command( "Utility", "ulx spawn", ulx.spawn, "!spawn" )
spawn:addParam{ type=ULib.cmds.PlayersArg }
spawn:defaultAccess( ULib.ACCESS_ADMIN )
spawn:help( "Spawns target(s)." )
----------------------------------------!points <players> x--------------------------------------------
function ulx.points( calling_ply, target_plys, amount )
local affected_plys = {}
for i=1, #target_plys do
local v = target_plys[ i ]
if v:Alive() then
v:GivePoints(amount)
table.insert(affected_plys, v)
end
end
ulx.fancyLogAdmin( calling_ply, "#A gave #i points to #T", amount, affected_plys )
end
local points = ulx.command( "Utility", "ulx points", ulx.points, "!points" )
points:addParam{ type=ULib.cmds.PlayersArg }
points:defaultAccess( ULib.ACCESS_SUPERADMIN )
points:addParam{ type=ULib.cmds.NumArg, min=1, default=1000000, hint="points", ULib.cmds.round }
spawn:help( "Sets the amount of points for the target(s)." )
---------------------------------------------------------------------------------------------------------
function ulx.ready( calling_ply, target_plys )
local affected_plys = {}
for k,v in pairs(target_plys) do
if !v:Alive() then
nz.Rounds.Functions.ReadyUp(v)
table.insert(affected_plys, v)
end
end
ulx.fancyLogAdmin( calling_ply, "#A readied #T", affected_plys )
end
local ready = ulx.command( "Utility", "ulx ready", ulx.ready, "!ready" )
ready:addParam{ type=ULib.cmds.PlayersArg }
ready:defaultAccess( ULib.ACCESS_ADMIN )
ready:help( "Readies the target(s)" )
--------------------------------------------------------------------------------------------------------
function ulx.nuke()
nz.PowerUps.Functions.Nuke()
for k,v in pairs(player.GetAll()) do
if v:Alive() then
v:TakePoints(500)
end
end
ulx.fancyLogAdmin( calling_ply, "#A dropped a nuke on the zombies!" )
end
local nuke = ulx.command( "Utility", "ulx nuke", ulx nuke, "!nuke" )
nuke:defaultAccess( ULib.ACCESS_SUPERADMIN )
nuke:help( "Nukes zombies without getting points to players, useful for ending rounds" )
[/lua]
[QUOTE=Splerge;48312849]
[lua]
local nuke = ulx.command( "Utility", "ulx nuke", ulx nuke, "!nuke" )
[/lua][/QUOTE]
ulx nuke should be ulx.nuke
thanks a lot, that fixed it!
and also I realised I forgot to have calling_ply as the variable in the function
Sorry, you need to Log In to post a reply to this thread.