mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-07-24 11:28:22 +02:00
New test gm scripts to help with positioning populace npcs
This commit is contained in:
parent
214d730a58
commit
8d5f4465e3
3 changed files with 95 additions and 0 deletions
32
Data/scripts/commands/gm/setpopulacepos.lua
Normal file
32
Data/scripts/commands/gm/setpopulacepos.lua
Normal file
|
@ -0,0 +1,32 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "sffff",
|
||||
description = "Moves an actor into a new position instantly",
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, name, posX, posY, posZ, rotation)
|
||||
|
||||
local actor;
|
||||
|
||||
if (name == nil) then
|
||||
player:SendMessage(0x20, "", "No name provided.");
|
||||
return;
|
||||
end
|
||||
|
||||
local pos = player:GetPos();
|
||||
local x = posX or pos[1];
|
||||
local y = posY or pos[2];
|
||||
local z = posZ or pos[3];
|
||||
local rot = rotation or pos[4];
|
||||
|
||||
actor = player.CurrentArea:FindActorInZoneByUniqueID(name);
|
||||
if (actor ~= nil) then
|
||||
actor:SetPos(x,y,z,rot,true);
|
||||
player:SendMessage(0x20, "", string.format("Moved %s @ %f, %f, %f, %f", name, x, y, z, rot));
|
||||
else
|
||||
player:SendMessage(0x20, "", string.format("Could not find %s.", name));
|
||||
end
|
||||
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue