Jump to content
  • 0

Bounce Back Teleport Script


Question

Posted (edited)

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

3 answers to this question

Recommended Posts

  • 0
Posted
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
  • 0
Posted

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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...