• Print

Author Topic: Forced Act Error  (Read 4518 times)

0 Members and 1 Guest are viewing this topic.

Offline Vaporouscreeper

  • Newbie
  • *
  • Posts: 22
  • Karma: 0
    • TheBox steam group
Forced Act Error
« on: April 15, 2018, 04:36:18 am »
I'm making a command to force an act to a target
but when ranned, i'm getting "[ERROR] addons/ulx/lua/ulx/modules/sh/tbox_fun.lua:7: attempt to call method 'ConCommand' (a nil value)"

Code: Lua
  1. function ulx.forceact(calling_ply,target_ply,act)
  2.         if act=="dance" then
  3.                 target_ply:ConCommand("act dance")
  4.         else
  5.                 ULib.tsayError(calling_ply,act.." is not an act")
  6.         end
  7.         ulx.fancyLogAdmin(calling_ply,false,"#A forced acted #s upon #T",act,target_ply)
  8. end
  9. local forceact = ulx.command(CATEGORY_NAME, "ulx forceact", ulx.forceact, "!forceact", false)
  10. forceact:addParam{ type=ULib.cmds.PlayersArg }
  11. forceact:addParam{ type=ULib.cmds.StringArg, hint="act", ULib.cmds.takeRestOfLine }
  12. forceact:defaultAccess(ULib.ACCESS_ADMIN)
  13. forceact:help("Forces target to act input Eg: !force ^ dance")
Edit: nvm had PlayersArg not PlayerArg
« Last Edit: April 15, 2018, 04:47:26 am by Vaporouscreeper »
I'm a Moderator on a server called TheBox. and i'm mostly active on it

  • Print