Page 1 of 1

Anyone have any examples on how to use the open command?

Posted: Tue Nov 24, 2009 2:36 pm
by Astal
Like in scripts. Say i have a chest, i want a player to open, when he does have it give him, gear, summon mobs and then despawn, cant find anything on forums or wiki. If you cant do that atm, ill just make it on attack

Re: Anyone have any examples on how to use the open command?

Posted: Tue Nov 24, 2009 3:15 pm
by Scatman
Use John's favorite function 'casted_on'. So give your box the "open" entity command and 'show_command_icon'=1. When you click on the box, the casted_on(NPC, Spawn, SpellName) will be ran. So something like this:

Code: Select all

function casted_on(NPC, Spawn, SpellName)
   if SpellName == "open" then
      SummonItem(Spawn, 500)
   end
end