• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Fly TFS 1.2

silveralol

Advanced OT User
Joined
Mar 16, 2010
Messages
1,484
Solutions
9
Reaction score
217
Hello, how the title says
I'm requesting a fly system in tfs 1.2 I have an idea to make it, then, the player if have certain mount or storage will create a invisible ground to he "fly" and when he walk will create another ground, and it go with this way, someone can help me?
 
You can use this one as example:
https://otland.net/threads/mock-fly-system-v-1-0.98171/
https://otland.net/threads/function-docreatetile-can-be-used-on-fly-systems.98172/

It's for 0.3.7 if I remember correctly.
It had some issues with landing in narrow spaces and walking near other flying players, though.
aff, I saw months ago that Codex NG make a little system to create a invisible tiles in tfs 1.2
but now he is banned, how I can see that system?

edit: I find it, will try by myself, but I'll still need help
https://otland.net/threads/tfs-1-2-moving-tile-flying-over-empty-spaces.238194/
I don't know where use it lol
 
found this in my map generator:
Code:
function newGround(pos, id)
	if not Tile(pos) then
		Game.createTile(pos)
	end
	return Game.createItem(id, 1, pos)
end

add fake combat there like mock did and should be sent to client properly (not sure if you even need it)


tile:getGround():remove() should do the trick (removing floor when player walks away)
 
found this in my map generator:
Code:
function newGround(pos, id)
    if not Tile(pos) then
        Game.createTile(pos)
    end
    return Game.createItem(id, 1, pos)
end

add fake combat there like mock did and should be sent to client properly (not sure if you even need it)


tile:getGround():remove() should do the trick (removing floor when player walks away)
see my code atm
Code:
function onSay(player, words, param)
    local sqmPos = player:getPosition()
    sqmPos.z = sqmPos.z - 1
    if param == 'up' or param == 'UP' then
        local sqm = Game.createTile(sqmPos) -- here the "ground" is created, but I can walk
        if not player:teleportTo(sqmPos) then
            player:say("now the player is on floor 0 and not up......", TALKTYPE_SAY)
            return true
        end
     end
     return false
end
the player up, have a new "tile" but he can't walk

edit:
I copy the function of Codex, is basically like yours
Code:
function newGround(pos, id)
    local tile = Tile(pos)
    if not tile then
        Game.createTile(pos)
        tile = Tile(pos)
        return tile
    end
    if not tile:getItemById(id) then
        return Game.createItem(id, 1, pos)
    end
    return false
end
 
Last edited:
of course he can't walk. There are no tiles around. That's why I linked to mock's system.
He made tiles around with actionids so script knows where player moved.
 
of course he can't walk. There are no tiles around. That's why I linked to mock's system.
He made tiles around with actionids so script knows where player moved.
Okay, thanks, now I'll fight to understand the code that he did, is hard to read without coding styles
HOLY SHIT! I understand how he did to players walk
LOL
I never think about it, I need to learn with those guy
 
@zbizu I found a pokemon system, I need to convert to tfs 1.2
could you help me ?
Code:
local del = {'460', '1022', '1023', '1024'}

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
    position.stackpos = 0
    if isPlayer(cid) and getCreatureOutfit(cid).lookType == 814 then 
        return false 
    end

    if getPlayerStorageValue(cid, 17000) <= 0 then
        doTeleportThing(cid, fromPosition, false)
        doRemoveItem(getTileThingByPos(position).uid, 1)
        doPlayerSendCancel(cid, "You can't fly.")
        return true
    end

    doAreaCombatHealth(cid, FLYSYSTEMDAMAGE, getThingPos(cid), splash, 0, 0, 255) -- the FLYSYSTEMDAMAGE is based on pokemon src // I think that not is needed make this false damage
   
    local pos = getThingPos(cid)
    if pos.z == 7 then 
        return true 
    end
   
    pos.z = pos.z + 1

    for i = 0, 255 do
        pos.stackpos = i
        local tile = getTileThingByPos(pos)
        if tile.itemid ~= 0 and not isCreature(tile.uid) then
            if hasProperty(tile.uid, 3) or hasProperty(tile.uid, 7) or tile.itemid == 919 then
                doTransformItem(item.uid, 11677)
            end
        end
    end

    return true
end

function onStepOut(cid, item, position, lastPosition, fromPosition, toPosition, actor)

    if isPlayer(cid) and getCreatureOutfit(cid).lookType == 814 then 
        return false 
    end

    local effect = 2

    if toPosition.z == fromPosition.z and getCreatureOutfit(cid).lookType ~= 316 and getCreatureOutfit(cid).lookType ~= 648 then
        doSendMagicEffect(fromPosition, effect)
    end

    local oldtpos = fromPosition
    oldtpos.stackpos = STACKPOS_GROUND


    if getTileThingByPos(oldtpos).itemid >= 1 then
        doRemoveItem(getTileThingByPos(oldtpos).uid, 1)
    end
   
    return true
end
 
Last edited:
@silveralol
workaround:
Code:
onStepIn(cid
to:
Code:
onStepIn(player
and add below this line:
Code:
local cid = player:getId()

same with onStepOut

Converting old scripts is a waste of time. It's better to rewrite them.
 
@silveralol
workaround:
Code:
onStepIn(cid
to:
Code:
onStepIn(player
and add below this line:
Code:
local cid = player:getId()

same with onStepOut

Converting old scripts is a waste of time. It's better to rewrite them.
ok, I'll try reWrite
I have the idea to make the system work, the logic, but make functions is the problem
 
Back
Top