Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Location gate (src.go)
Author Message
Snaigel
Journeyman
*

Posts: 75
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Jan 2017
Reputation: 0



Post: #1
Location gate (src.go)
I'm trying to do a gate that teleports players to a specific location, but I want it to don't let harmed people travel, and only players, no npcs. But it lets npc to travel and harmed people aswell.

My script looks like this:

Quote:[ITEMDEF i_gate_cemen]
DEFNAME=i_gate_cemen
ID=i_moongate_black
NAME=Portal misterioso
CATEGORY=Gates
SUBSECTION=Dungeons
DESCRIPTION=Entrada Cemen brit niv2


ON=@DCLICK
IF (<DISTANCE> > 2)
SRC.SYSMESSAGE Estas demasiado lejos.
RETURN 1
ELSE
SRC.GO=5225,1726
ENDIF
IF (<SRC.ISPLAYER>)
SRC.GO=5225,1726
ELSE
RETURN 1
ENDIF
if (<EVAL (<src.hits>*100) > < <EVAL (<src.str>*100) >)
src.sysmessage ¡No puedes traspasarlo estando herido!
return 1
endif
else
SRC.GO=5225,1726
endif

ON=@Step

IF (<SRC.ISPLAYER>)
SRC.GO=5225,1726
ELSE
RETURN 1
ENDIF
if (<EVAL (<src.hits>*100) > < <EVAL (<src.str>*100) >)
src.sysmessage ¡No puedes traspasarlo estando herido!
return 1
endif
else
SRC.GO=5225,1726
endif
01-30-2017 10:31 PM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #2
RE: Location gate (src.go)
NPCs can't dclick on items, so maybe it's better change the item to use only @Step instead @DClick
Code:
[ITEMDEF i_gate_cemen]
DEFNAME=i_gate_cemen
ID=i_moongate_black
NAME=Portal misterioso

CATEGORY=Gates
SUBSECTION=Dungeons
DESCRIPTION=Entrada Cemen brit niv2

ON=@Step
IF !(<SRC.ISPLAYER>)
  return 1
ELIF (<SRC.HITS> < <SRC.MAXHITS>)
  SRC.SYSMESSAGE ¡No puedes traspasarlo estando herido!
  return 1
ENDIF
SRC.GO 5225,1726
01-31-2017 01:11 AM
Find all posts by this user Like Post Quote this message in a reply
Snaigel
Journeyman
*

Posts: 75
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Jan 2017
Reputation: 0



Post: #3
RE: Location gate (src.go)
Thank you it works perfect. And another thing, when you stay on the gate, you keep traveling repeated times, it's annoying, is there a way to don't let it happen?, maybe a simple delay?
01-31-2017 01:51 AM
Find all posts by this user Like Post Quote this message in a reply
Leonidas
Master
**

Posts: 277
Likes Given: 3
Likes Received: 13 in 12 posts
Joined: May 2013
Reputation: 1



Post: #4
RE: Location gate (src.go)
If they teleport once they shouldn't teleport again, unless you have another gate at 5225,1726.
01-31-2017 09:49 AM
Find all posts by this user Like Post Quote this message in a reply
Snaigel
Journeyman
*

Posts: 75
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Jan 2017
Reputation: 0



Post: #5
RE: Location gate (src.go)
Ah yes, I've forgot to mention that, I've placed a teleport in the other side, so I'm stupid and I only have to move it xd
01-31-2017 09:54 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)