PDA

View Full Version : [Lua]Unstuck Command.



Cocain
27-03-10, 11:03 AM
--[[
Unstuck command.
--]]

print("VIP Commands..\nMade By Cocain")

-----Local--------
local MSG_UNSTUCK = "#unstuck"

----FUNCTION-------
function GetTeam(Player)
local r = Player:GetPlayerRace()
if (r == 2 or r == 5 or r == 6 or r == 8 or r == 10) then -- horde
return 1
elseif (r == 1 or r == 3 or r == 4 or r == 7 or r == 11) then -- ally
return 0
end
end

function OnChat(event, player, message, type, language)
if(message == MSG_UNSTUCK) then
if (player:IsInCombat()==true) then
player:SendAreaTriggerMessage("You are in combat!")
else
if(GetTeam(player) == 1) then
player:Teleport(1, 1629.551147, -4373.380371, 31.491497) ----Org
elseif(GetTeam(player) == 0) then
player:Teleport(0, -8828.930664, 625.082886, 93.917816) ---Stormwind
end
end
end
end

RegisterServerHook(16, "OnChat")

Basic script, just unstucks you. Teleports you to Org when you're horde. To stormwind when you're an ally.