Title says it all xP
how can i teleport my self to a npc with command?
Thanks :)
how can i teleport my self to a npc with command?
Thanks :)
if (Cmd[0] == "/mmtonpc")
{
foreach (Game.NPC N in World.H_NPCs.Values)
{
if (uint.Parse(Cmd[1]) == N.EntityID)
GC.MyChar.Teleport(N.Loc.Map, N.Loc.X, N.Loc.Y);
}
break;
}
The Red one is entity IDQuote:
101736 1507 21 0 1039 481 289
Can't remember how to do this right but you wouldn't want to tele direct onto the NPC so you would want to make the X and Y coords like -1 or +1Quote:
so your command is /mmtonpc NPCENTITYIDCode:if (Cmd[0] == "/mmtonpc") { foreach (Game.NPC N in World.H_NPCs.Values) { if (uint.Parse(Cmd[1]) == N.EntityID) GC.MyChar.Teleport(N.Loc.Map, N.Loc.X, N.Loc.Y); } break; }
if you Don't know what's EntityID, let me help you
here's an example from NPCs.txt
The Red one is entity ID
__________________________________________
Press thanks if it helped :P
I tested it , it works fine..Character isn't stuck.Quote:
Can't remember how to do this right but you wouldn't want to tele direct onto the NPC so you would want to make the X and Y coords like -1 or +1
GC.MyChar.Teleport(N.Loc.Map, N.Loc.X -1, N.Loc.Y -1);
Well that is in my source lol but going right onto an NPC I think would bug the char and you wouldnt be able to move... (I hope im right lol if not I look like an idiot) haha