示例
-- 快速传送系统
local teleportLocations = {
["暴风城"] = {0, -8949.95, -132.493, 83.5312, 0},
["奥格瑞玛"] = {1, 1676.21, -4315.29, 61.5243, 1.06},
["铁炉堡"] = {0, -4981.25, -881.542, 501.66, 2.16},
["雷霆崖"] = {1, -1274.45, 71.8601, 128.159, 2.80}
}
local function QuickTeleport(player, locationName)
local location = teleportLocations[locationName]
if location then
local success = TeleportPlayer(player, location[1], location[2], location[3], location[4], location[5])
if success then
player:SendBroadcastMessage("传送到 " .. locationName .. " 成功!")
else
player:SendBroadcastMessage("传送失败,请稍后再试")
end
else
player:SendBroadcastMessage("未知的传送位置: " .. locationName)
end
end