Items that calls up a script

PunkBuster

New member
Messages
216
Points
0
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.

 
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.

 
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

 
Back
Top