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:
[code]local tTools = {
"weapon_physgun",
"weapon_toolgun"
}
local function fGiveTools( _, pTarget )
for i = 1, #tTools
pTarget:Give( tTools[i] )
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" )[/code]
I'll give it a try and let you know. :)
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.
[code]local tTools = {
"weapon_physgun",
"weapon_toolgun"
}
local function fGiveTools( _, pTarget )
for i = 1, #tTools do
pTarget:Give( tTools[i] )
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" )[/code]
[QUOTE=TheEmp;51238023][code]local tTools = {
"weapon_physgun",
"weapon_toolgun"
}
local function fGiveTools( _, pTarget )
for i = 1, #tTools do
pTarget:Give( tTools[i] )
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" )[/code][/QUOTE]
Still doesn't work. :cry:
Anyone have one that works?
Sorry, you need to Log In to post a reply to this thread.