namco
Alienbutserious
- Joined
- Sep 5, 2010
- Messages
- 148
- Solutions
- 2
- Reaction score
- 38
@WibbenZ @mrianuraa
I've fixed but I'm having some trouble
I can't fly and when I say !up I can only see the teleporting effect over me
No console errors
I've fixed but I'm having some trouble
I can't fly and when I say !up I can only see the teleporting effect over me
No console errors
Lua:
function Position:createFlyFloor()
for i,deltaPos in ipairs(createFlyFloorHelperData) do
local pos = Position()
local currPos = {x = pos.x + deltaPos.x, y = pos.y + deltaPos.y, z = pos.z}
local toTile = Tile(currPos)
if (not toTile) or (not toTile:getItems()) or (not toTile:getGround()) then
doAreaCombatHealth(0, 0, currPos, 0, 0, 0, 0)
Game.createItem(460, 1, currPos)
end
end
end
function Position:removeFlyFloor()
for i,deltaPos in ipairs(createFlyFloorHelperData) do
local pos = Position()
local currPos = {x = pos.x + deltaPos.x, y = pos.y + deltaPos.y, z = pos.z}
local fromTile = Tile(currPos)
local fromFlyItem = fromTile:getItemById(460)
if fromFlyItem then
fromFlyItem:remove()
end
end
end
Lua:
function Player:flyUp()
if self:isFlying() then
if self:canFlyUp() then
local pos = self:getPosition()
local tile = Tile(pos)
local itemfloor = tile:getItemById(460)
if itemfloor then
pos:removeFlyFloor()
end
pos.z = pos.z-1
pos:createFlyFloor()
self:teleportTo(pos)
pos:sendMagicEffect(CONST_ME_TELEPORT)
return true
end
return false
else
self:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You are not flying.")
end
end