SphereCommunity
Close/Open door - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: Close/Open door (/Thread-Close-Open-door)



Close/Open door - an0n!m0use - 11-15-2015 11:46 PM

Hi, i have some problem with my script ...
I have locked door
PHP Code:
[ITEMDEF i_door_locked]
DEFNAME=i_door_locked
NAME
=Locked door
ID
=0693
TYPE
=t_door_locked

On
=@DClick
    
IF <SRC.ACCOUNT.PLEVEL> > 3
        
RETURN 0
    
ENDIF
    
SRC.MESSAGE That door is locked
    
RETURN 1

CATEGORY 
PvP Arena Items
SUBSECTION 
Diffrent
DESCRIPTION 
Barred Metal Door (locked) (nw

And NPC with triggers:
PHP Code:
On=@EnvironChange
    
IF <SRC.REGION.TAG0.door_uid>
      
REF1 = <SRC.REGION.TAG0.door_uid>
    
SAY 1 // This working ! NPC say "1"
        
IF <REF1.DispID> == 0694 // open
          
REF1.DispID 0693
          REF1
.MOVE 0,1
        
ENDIF
    ENDIF

On=@Death
    
IF <REGION.TAG0.door_uid>
        
REF1 = <REGION.TAG0.door_uid>
    
SAY 2 // And this working when NPC die ...
          
IF <REF1.DispID> == 0693 // closed
            
REF1.DispID 0694
            REF1
.MOVE 0,-1
            REF1
.SOUND 235
        
ENDIF
    ENDIF 

P.S - REGION.TAGLIST = TAG.door_uid=01

Why not working ? Doubt


RE: Close/Open door - azmanomer - 11-16-2015 08:26 AM

did you check the tag? are they match with door uid? why are you moving doors? just use "dclick <ref1>"


RE: Close/Open door - Coruja - 11-16-2015 10:47 AM

you must your door UID on TAG.door_id instead set a random "1" just to fill the tag

if you use this:
Code:
TAG.door_uid = 01
REF1=<TAG0.door_uid>
it will be the same as set REF1=01, so this REF1 will point to UID 01 and not to your door UID. So if your door UID is 123456, you must set TAG.door_uid=123456


RE: Close/Open door - an0n!m0use - 11-17-2015 05:54 AM

(11-16-2015 08:26 AM)azmanomer Wrote:  did you check the tag? are they match with door uid? why are you moving doors? just use "dclick <ref1>"
Thx for help! And for the advice about "dclick <ref1>"


(11-16-2015 10:47 AM)Coruja Wrote:  So if your door UID is 123456, you must set TAG.door_uid=123456
Thx man Wink It working perfectly !