Jump to content
  • 0

Bounce Back Teleport Script


cahadeyelo

Question


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  170
  • Reputation:   1
  • Joined:  11/13/14
  • Last Seen:  

Hi rA community. Can i request a script that will teleport the player back to it's recent location after touching a specific npc.
 

EXAMPLE SCENARIO:

A player is happily farming on um_fild01 then triggers the script when he/she kills 100 Dryads. He/She will be teleported to sec_pri then after he/she clicks a walking/sliding npc inside prison. The npc will teleport him/her back to his/her recent exact location on um_fild01. And he/she lives happily ever after. Thank You.

 

Edited by cahadeyelo
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  7
  • Reputation:   5
  • Joined:  03/09/23
  • Last Seen:  

3 minutes ago, cahadeyelo said:

Hi rA community. Can i request a script that will teleport the player back to it's recent location after touching a specific npc.
 

EXAMPLE SCENARIO:

A player is happily farming on um_fild01 then triggers the script when he kills 100 Dryads. He/She got teleported to sec_pri then after he/she clicks a walking/sliding npc inside prison. The npc will teleport him/her back to his/her recent exact location on um_fild01. And he/she lives happily ever after. Thank You.

 

-	script	DryadKillCounter	-1,{
OnPCKillEvent:
	if (killedrid == DRYAD_MOB_ID) {
		.@kills = killcount(DRYAD_MOB_ID);
		if (.@kills == 100) {
			set saveMap$, strcharinfo(3);
			set saveX, getcharinfo(0);
			set saveY, getcharinfo(1);
			warp "sec_pri", X_COORD, Y_COORD; // Teleport player to sec_pri (Replace X_COORD and Y_COORD with actual coordinates)
		}
	}
	end;
}

sec_pri,X_COORD,Y_COORD,5	script	Returning NPC	722,{
	if (killcount(DRYAD_MOB_ID) > 99) {
		mes "I noticed you've killed 100 Dryads in um_fild01.";
		mes "Do you want to return to where you were?";
		next;
		if(select("Yes:No") == 1) {
			set killcount(DRYAD_MOB_ID), 0; // Reset the kill count for Dryads
			warp saveMap$, saveX, saveY; // Return player to their saved location
		}
	}
	else {
		mes "You have no reason to interact with me.";
	}
	close;
}

pay attention to items:

X_COORD
Y_COORD
DRYAD_MOB_ID


Just make the appropriate substitutions

  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  170
  • Reputation:   1
  • Joined:  11/13/14
  • Last Seen:  

Sir what is the main function of this code:  getcharinfo(0); and getcharinfo(1); ? Because when i tried to run the script, an error to map server shows
parse_line: expected ';'

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  896
  • Reputation:   118
  • Joined:  05/23/12
  • Last Seen:  

The *getcharinfo doesn't exist. Replace:

set saveMap$, strcharinfo(3);

   set saveX, getcharinfo(0);

   set saveY, getcharinfo(1);

 

With:

getmapxy(saveMap$,saveX,saveY,BL_PC);

 

Rynbef~

  • Love 2
Link to comment
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.   Paste as plain text instead

  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.

×
×
  • Create New...