General > Developers Corner

Trigger ULX Command with Command

(1/1)

BLEEP_BLOOP:
I am trying to make a simple code that allows me to do !build in-game to put the player in god and !kill to ungod the player. This is what I got so far:


--- Code: ---local CATEGORY_NAME = "Utility"

timer.Create( "build", .3, 1, function( target_plys )
if Player:Alive() then
    RunConsoleCommand( "ulx god", Player:Name() ) end
end )
end

timer.Create( "kill", .3, 1, function( target_plys )
        RunConsoleCommand( "ulx ungod", playername) end
end )
end
)
--- End code ---

It throws out the error: '<eof>' expected near 'end'. Can someone please explain why? Any help would be appreciated.

Thanks,
BLEEP_BLOOP :D

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given

[0] Board index

Go to full version