teotwawki wrote:doc730 wrote:
Im looking specificly way to port to a @where position.
That would be the function he just showed you, just replace the zeros. They are: x, y, z, rotation, zoneId. The GM command to use them is @pos
@pos 51 -113 15 64 49
Would place me at x51 y-113 z15 rot64 in zone 49.
Ouside of the Gm command, you'd use object:setpos() inside your script as Delaide showed you replacing the values with what you need.
Ok, after I added my x, y, z, rotation, zoneId and I attempt to use the command it tells me "YOu must enter a zone id." Please tell me what I am doing wrong.
This is what I have:
---------------------------------------------------------------------------------------------------
-- func: onTrigger
-- desc: Called when this command is invoked.
---------------------------------------------------------------------------------------------------
function onTrigger(player, zoneId)
local word = "";
local i = 0;
local zone = 70;
-- Ensure a zone was given..
if (zoneId == nil) then
player:PrintToPlayer("You must enter a zone id.");
return;
end
-- Was the zone auto-translated..
if (string.sub(zoneId, 1, 2) == '\253\02' and string.byte(zoneId, 5) ~= nil and string.byte(zoneId, 6) == 0xFD) then
-- Pull the group and message id from the translated string..
local groupId = string.byte(zoneId, 4);
local messageId = string.byte(zoneId, 5);
-- Attempt to lookup this zone..
for k, v in pairs(zone_list) do
if (v[1] == groupId and v[2] == messageId) then
player:setPos(0, 0, 0, 0, v[3]);
return;
end
end
-- Zone was not found, allow the user to know..
player:PrintToPlayer('Unknown zone, could not teleport.');
return;
end
player:setPos(-320, 0, -474, 61, 70);
end
And i inputing the pos in the wrong line?