ULX give tools command

I was wondering if someone would be able to create a command for ULX that if you gave someone tools the would receive a toolgun and a physgun for example

!givetools [NAME]

That’d be amazing if someone could do that.

I believe this should work – not familiar with ULX command syntax:


local tTools = {
   "weapon_physgun",
   "weapon_toolgun"
}

local function fGiveTools( _, pTarget )
   for i = 1, #tTools
      pTarget:Give( tTools* )
   end
end

local cmd = ulx.command( "Utilities", "givetools", fGiveTools )
cmd:defaultAccess( ULib.ACCESS_SUPERADMIN )
cmd:help( "Gives the target user a set of building tools" )

I’ll give it a try and let you know. :slight_smile:

No it doesn’t work sadly.

It’s not a chat command; couldn’t figure out the ULX syntax for that. Use the console with givetools.


local tTools = {
   "weapon_physgun",
   "weapon_toolgun"
}

local function fGiveTools( _, pTarget )
   for i = 1, #tTools do
      pTarget:Give( tTools* )
   end
end

local cmd = ulx.command( "Utilities", "givetools", fGiveTools, "!givetools", true  )
cmd:addParam{ type=ULib.cmds.PlayerArg, target="*" }
cmd:defaultAccess( ULib.ACCESS_SUPERADMIN )
cmd:help( "Gives the target user a set of building tools" )

Still doesn’t work. :cry:

Anyone have one that works?