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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

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