AddPrimaryEntityCommand(Spawn: Player, Spawn: Target, String: Name, Float: Distance, String: Command, String: ErrorText, Int16: CastTime, Int32: SpellVisual, Int8: DenyListDefault)
Pre-Requisite(s)
- None
Parameter(s)
Spawn: Player (OPTIONAL) - Spawn LUA Pointer of Player type only, if nil is sent then entity command is applied for all Players.
Spawn: Target - The Target Player/NPC/Spawn the entity command will be applied to.
String: Name - Display name in the right click context menu for the entity command.
String: Command - Command (function) in the LUA script to handle selecting the entity command.
String: ErrorText (OPTIONAL) - Displays error text with command name.
Int16: CastTime (OPTIONAL) - Time to cast entity command.
Int32: SpellVisual (OPTIONAL) - SpellVisual to display when casting
Int8: DenyListDefault (OPTIONAL) - Set to 1 creates a deny list of Player(s) instead of an allow list.
Return(s)
- None
Example(s)
--AddPrimaryEntityCommand(Spawn,NPC,"",0,"") -- removes all the primary entity commands (including hail)
--AddPrimaryEntityCommand(Spawn,NPC,"hail",10000,"hail") -- adds the hail command back to the npc
--SendUpdateDefaultCommand(NPC,10000,"hail") -- returns the bubble option when you hover over the spawn/npc
--AddPrimaryEntityCommand(Spawn,NPC,"hail2",10000,"hail2","",0,0,1) -- 1 at the end sets this as a default DENY list, if Spawn is supplied and not null/not player then that player gets default allow access. Any other players must be added (either by calling the AddPrimaryEntityCommand or subsequently SetAccessToEntityCommand)
--SetAccessToEntityCommand(Spawn,NPC,"hail2",0) -- removes access to the just created hail2 for that player
--SetAccessToEntityCommand(Spawn,NPC,"hail2",1) -- adds access to hail2 for that Spawn (player)
--RemovePrimaryEntityCommand(NPC,"hail2") -- removes hail2 command for all players
Result
Additional Notes