Create instance for just one player

Tio Akima

New member
Messages
349
Points
0
Age
36
Discord
TioAkima#0636
Github
Tio Akima
Emulator
[ Create instance for just one player ]

guys

I created an npc with several quests and that creates an instance and teleports the player to the map ...

Everything works normal if the player has a group, but if I attach the instance to the player it does not teleport.

IM_NONE: Attached to no one.  

IM_CHAR: Attached to a single character.  

IM_PARTY: Attached to a party (default instance mode).  

IM_GUILD: Attached to a guild.  

IM_CLAN: Attached to a clan.

It creates the instance, however when attaching the instance in the player (and not in the group) the script does not execute the instance_enter Is it possible to do that?

attach only one player? (without being in a group)

 
It's IOT_CHAR, not IM_CHAR

Code:
.@char = getcharid(CHAR_ID_CHAR);
.@account = getcharid(CHAR_ID_ACCOUNT);
.@map_name$ = "mapname"; // the map you want to instance
.@instance_name$ = sprintf("%s@%i%d", .@map_name$, .@char, gettime(GETTIME_SECOND)); // a unique name for your instance
.@instance = instance_create(.@instance_name$, .@account, IOT_CHAR); // create the instance and attach it to the char
.@instanced_map_name$ = sprintf("%s@%i", .@map_name$, .@instance); // a unique name for the instanced map
.@map$ = instance_attachmap(.@map_name$, .@instance, false, .@instanced_map_name$); // attach the instanced map to your instance
instance_timeout(600, 1, .@instance); // alive and idle timeout, in seconds

// setup is ready so init the instance and warp the player
instance_init(.@instance);
warpchar(.@map$, 20, 20, .@char); // the (x,y) starting point
 
Last edited by a moderator:
It's IOT_CHAR, not IM_CHAR

.@char = getcharid(CHAR_ID_CHAR);
.@account = getcharid(CHAR_ID_ACCOUNT);
.@map_name$ = "mapname"; // the map you want to instance
.@instance_name$ = sprintf("%s@%i%d", .@map_name$, .@char, gettime(GETTIME_SECOND)); // a unique name for your instance
.@instance = instance_create(.@instance_name$, .@account, IOT_CHAR); // create the instance and attach it to the char
.@instanced_map_name$ = sprintf("%s@%i", .@map_name$, .@instance); // a unique name for the instanced map
.@map$ = instance_attachmap(.@map_name$, .@instance, false, .@instanced_map_name$); // attach the instanced map to your instance
instance_timeout(600, 1, .@instance); // alive and idle timeout, in seconds

// setup is ready so init the instance and warp the player
instance_init(.@instance);
warpchar(.@map$, 20, 20, .@char); // the (x,y) starting point

.@char = getcharid(CHAR_ID_CHAR);
.@account = getcharid(CHAR_ID_ACCOUNT);
.@map_name$ = "mapname"; // the map you want to instance
.@instance_name$ = sprintf("%s@%i%d", .@map_name$, .@char, gettime(GETTIME_SECOND)); // a unique name for your instance
.@instance = instance_create(.@instance_name$, .@account, IOT_CHAR); // create the instance and attach it to the char
.@instanced_map_name$ = sprintf("%s@%i", .@map_name$, .@instance); // a unique name for the instanced map
.@map$ = instance_attachmap(.@map_name$, .@instance, false, .@instanced_map_name$); // attach the instanced map to your instance
instance_timeout(600, 1, .@instance); // alive and idle timeout, in seconds

// setup is ready so init the instance and warp the player
instance_init(.@instance);
warpchar(.@map$, 20, 20, .@char); // the (x,y) starting point



oh nice!!! thanks Meko 
Solved

 
Back
Top