Hey,
I finished a script which start's when a new Dwarf character enters the world for the first time. It mounts the character on a dragon mount and sends them along a flight path until it lands.
The script worked fine the first time but I can't get it to work again, I havent edited it since it worked either.
I am requesting that somebody that knows more than me about Lua check over my script and help correct any errors.
Code:
local PlayerA = nil -- This will be the player we use to do the event
function Player_OnFirstEnterWorld(event, pPlayer) -- When they first enter world
if PlayerA == nil then -- If a player is not being used currently, a bug check so that we do not do it two times
local race = pPlayer:GetPlayerRace() -- We get the race of the person that we shall use
if race == 3 then -- THIS IS THE DWARF RACE, change to what you want.
pPlayer:MovePlayerTo(pPlayer:GetX(),pPlayer:GetY(),pPlayer:GetZ()+0.1, pPlayer:GetO(), 12288) -- Move him slightly to play client side effects and shizzle
PlayerA = pPlayer -- Here we tell the script we are now using a player
local Taxi = LuaTaxi:CreateTaxi()
Taxi:AddPathNode(1, 7004.322754, -4489.964355, 775.313782)
Taxi:AddPathNode(1, 7257.313965, -4375.766113, 740.363281)
Taxi:AddPathNode(1, 7497.269531, -4221.551270, 713.837646)
Taxi:AddPathNode(1, 7617.333984, -4035.526611, 731.109924)
Taxi:AddPathNode(1, 7958.402344, -3876.793213, 715.259521)
Taxi:AddPathNode(1, 8045.714355, -3859.658691, 696.492920)
pPlayer:StartTaxi(Taxi, 6378)
pPlayer:SendChatMessage(1, 6, "Finally I'm almost at the camp!")
else
PlayerA = nil -- if the player is not the race we wanted, reset it
end
else -- if the event is in use
end
end
RegisterServerHook(3, "Player_OnFirstEnterWorld")
function MassDespawnAndResetoajphae(pUnit, Event)
PlayerA = nil -- All we need to do is say that the slot for a creating character is nil again
end
-Credit's to Stoneharry for (http://www.mmowned.com/forums/world-...om-intros.html) which the script is based uppon.