Hello i tried to write my first ulx command it did not work i was hoping someone on here could tell me what i did wrong
local CATEGORY_NAME = "MyULX"
function ulx.tools ( calling_ply, target_ply )
target_ply:Give("weapon_physgun", "gmod_tool")
ulx.fancyLogAdmin ( calling_ply, true "#A Gave tools to #T", target_ply )
end
end
local tools = ulx.command ( CATEGORY_NAME, "ulx tools", ulx.tools
"!tools", true )
tools:addParam{ type=ULib.cmds.PlayerArg }
tools:defaultAccess ( ULib.ACCESS_ADMIN )
tools:help ( "Gives the target the physgun and tool gun" )
Do you have an error?
target_ply:Give("weapon_physgun", "gmod_tool")
You cant give multiple weapons at once.
In the fancyLogAdmin function, you forgot a comma.
There might be more mistakes, but that's waht I saw by taking a quick look.
No it just does not show up in menu and the command does not work
ulx.fancyLogAdmin ( calling_ply, true, "#A Gave tools to #T", target_ply )
You wouldn't have to make two commands just do
target_ply:Give("weapon_physgun")
target_ply:Give("gmod_tool")
I did it with the edits and it still didn't work
local CATEGORY_NAME = "MyULX"
function ulx.tools ( calling_ply, target_ply )
target_ply:Give("weapon_physgun")
target_ply:Give("gmod_tool")
ulx.fancyLogAdmin ( calling_ply, true, "#A Gave tools to #T", target_ply )
end
end
local tools = ulx.command ( CATEGORY_NAME, "ulx tools", ulx.tools
"!tools", true )
tools:addParam{ type=ULib.cmds.PlayerArg }
tools:defaultAccess ( ULib.ACCESS_ADMIN )
tools:help ( "Gives the target the physgun and tool gun" )
I am on mobile currently but you have too many ends in your function
Sorry, you need to Log In to post a reply to this thread.