Jump to content
  • 0
PunkBuster

Items that calls up a script

Question

Is it possible to create an item that calls up a script?

What I want to do is an item that stays permanently on player's inventories. When it is used, it calls up a script that give information about the current users on the map.

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0
21 hours ago, PunkBuster said:

Is it possible to create an item that calls up a script?

What I want to do is an item that stays permanently on player's inventories. When it is used, it calls up a script that give information about the current users on the map.

It would look something like this:

first create a script and put its function there, example:
 

function	script	scripttest	{
	getmapxy @map$,@x,@y,0;	
	dispbottom "Quantidade de jogadores no mapa atual: "+getmapusers(@map$);
end;
}

then just go to the item script and use callfunc, in this example I used '2201':

	Id: 2201
	AegisName: "Sunglasses"
	Name: "Sunglasses"
	Type: "IT_ARMOR"
	Buy: 5000
	Weight: 100
	Loc: "EQP_HEAD_MID"
	Refine: false
	ViewSprite: 12
	Script: <" bonus2 bResEff,Eff_Blind,500; callfunc "scripttest"; ">


You can also make this number update every time the number of players changes on this map, it all depends on what you want.

Share this post


Link to post
Share on other sites
  • 0

if you need also player interaction from item script, need call npc label in one of ways for attach npc to player. after you can use select/menu etc

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.