RES EVENT - Printable Version +- SphereCommunity (https://forum.spherecommunity.net) +-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d) +--- Forum: Script Help (/Forum-Script-Help) +--- Thread: RES EVENT (/Thread-RES-EVENT) |
RES EVENT - dabritmusic - 01-23-2014 09:56 AM im having trouble getting this event to res you after the timer. not too sure hat i did wrong. ive been reading spherewiki and couldnt see anything. [PLEVEL 1] res [FUNCTION RES] IF <SRC.TAG.RES>=1>> src.findid.i_res_delay.remove SRC.TAG.RES=0 SYSMESSAGE @079 You have changed your mind about Resurrecting! RETURN 1 ELSE IF ((<SRC.BODY>==c_ghost_man) ||(<SRC.BODY>==c_ghost_woman)) SRC.NEWITEM=i_res_delay SRC.ACT.EQUIP SRC.MESSAGE @0481 You Will Be Ressurected In 60 Seconds. Please Stay On Your Body! ELSE SRC.MESSAGE @0481 You Cannot Use This Command While Alive! RETURN 1 [ITEMDEF i_res_delay] DEFNAME=i_res_delay ID=i_handr_1 NAME=Res Delay TYPE=T_EQ_SCRIPT LAYER=30 WEIGHT=0 ON=@CREATE ATTR=attr_invis MORE1=5 ON=@EQUIP TIMER=1 ON=@Timer if ( <cont> ) if ( <more1> ) cont.message @079 <EVAL(<more1>)> more1=<more1>-1 TIMER=1 return 1 ENDIF SRC.RESURRECT src.sfx 01eb src.spelleffect 06 1000 RETURN 1 RE: RES EVENT - darksun84 - 01-23-2014 10:06 AM The first IF in the REs function should be <src.tag.res> == 1 The else if check should be in the same line ( don't know if it was caused by the copy&paste) Item created by newitem function should be referenced by NEW.blabla Missing an endif after the final return 1 in Res Function In @Timer endif is missing after the final return 1 Also tag.res is never set to 1 btw ! Hope it can helps ! Best regards, Pietro RE: RES EVENT - XuN - 01-23-2014 06:08 PM And you are mixing (default) with (src) in the function so if you type .xres ingame, the lines with SRC will be executed on you, as you are the source who is calling the function, instead of the player. IF ((<SRC.BODY>==c_ghost_man) ||(<SRC.BODY>==c_ghost_woman)) -> IF (<FLAGS>&STATF_DEAD) // that will check for death status instead for an specific body values, so it will work for elfs and gargoyles too and with less checks. SRC.NEWITEM -> SERV.NEWITEM SRC.ACT.EQUIP -> EQUIP=<NEW> ON=@Timer triggers doesn't have SRC, as the src would be the server itself calling the timer to expire out, if you want to refer to the player holding it you should use CONT and change a few SRC you have there. Also, and very important, you must use REMOVE on the item after resurrecting the player or you will have a problem with tons of items on each player. RE: RES EVENT - Extreme - 01-23-2014 10:23 PM Cont.resurrect Sent from my GT-I9505 using Tapatalk |