• 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!

Search results

  1. M

    TFS 1.X+ Trade BUG

    I've been testing trade functionality recently and there is one bug I wanted to address. If someone could test it to confirm it would be great. Latest 1.3 TFS To reproduce the bug: Have your 1st character with only magic sword in your left hand or any other type of equipment. Make sure you DO...
  2. M

    TFS 1.X+ Structuring string in Lua from 2 tables?

    Recently I was trying to make better strings displayed to user. So here we have this code to make new table: EX1 local table = { InnerTable1 = {"str1", "str2", "str3"} InnerTable2 = {"str5", "str6"} } EX2 local table = { InnerTable1 = {"str1"} InnerTable2 = {"str7", "str8"...
  3. M

    TFS 1.X+ onTradeAccept bug?

    I was just getting familiar with new function Player:onTradeAccept(target, item, targetItem) and I believe there is a bug. I mean, it does work as it should with one exception. The function is executing even when the trade has not been successful due to lack of space or similar. Is there an...
  4. M

    TFS 1.X+ Ignore creatures when using getPathTo

    I need help with getPathTo function. Not sure if it's possible but I want to ignore any creatures along the way. I.e. when you click your mouse in client on specific position it will go there. It checks for obstacles on your way such as walls, creatures, etc. My question is, how do you execute...
  5. M

    TFS 1.X+ addCondition bug

    Just moved to latest TFS version and it's been great so far. The only thing that pops up in my console is few error messages: Alright, so it's not a big deal. Just change the function. The thing is it does not work. Even when using examples from github. Let's say scripts/custom/combustion.lua...
  6. M

    TFS 1.X+ Receiving Condition Attribute List

    I had a look in the sources and one of the things that I think could be useful is obtaining parameters. If you look here: https://github.com/otland/forgottenserver/blob/master/src/luascript.cpp#L2635 You can see we have something called setParameter, but there is no getParameters. Let's say...
  7. M

    TFS 1.X+ onSpawn for one monster

    How can you assign onSpawn function to one monster? Specifically in creaturescripts like this: <script> <event name="myScript"/> </script> I have something similar in mind to onPrepareDeath, i.e. onPrepareSpawn. It checks if certain item is in the area, if so; prevents spawn of the monster
  8. M

    TFS 1.X+ Where can you find the spells.xml function

    Go to TFS 1.0 version on Github and check spells.xml file. otland/forgottenserver (https://github.com/otland/forgottenserver/blob/1.0/data/spells/spells.xml#L128) You can see that exiva has a "function" specified as "searchPlayer" Anyone knows where you can find it? Thanks
  9. M

    TFS 1.X+ No interval in creaturescripts?

    I need to use creaturescripts instead of globalevents because there, we can register events to the creatures we want Added this function so far function onThink(cid, interval) print(interval) end and this is what I have in xml file: <event type="think" name="printMsg" interval="2000"...
  10. M

    Lua Error when sending packets

    Hi, I am trying to send network message to the client to update name of the summon. Here is the code so far: function Player.updateName(self, creatureId, creatureName) local msg = NetworkMessage() msg:addU32(creatureId) msg:addString(creatureName) msg:sendToPlayer(self)...
  11. M

    TFS 1.X+ Help with refactoring code

    I would be so grateful if someone could help me with this code, it seems really hard for me to figure it out. local combat = Combat() combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false) local function movePlayer(cid, pos, iteration) local player = Player(cid) player:teleportTo(pos...
  12. M

    TFS 1.X+ passing arguments to onTargetCreature(cid, var)

    just curious how would you make it work- passing one argument to onTargetCreature onTargetCreature will execute for every target it hits local combat = Combat() combat:setParameter(COMBAT_PARAM_EFFECT, 12) combat:setArea(createCombatArea(AREA_SQUAREWAVE5)) function onTargetCreature(cid...
  13. M

    TFS 1.X+ How do you add custom function to enemies that you hit?

    Lets say we have this code here local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, 52) local area = createCombatArea({ {1, 0, 0, 1, 0, 0, 1}, {0, 1, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 1, 0}, {1, 1, 1, 3...
  14. M

    TFS 1.X+ Talkactions command while muted / Change Player Direction

    Hi, I would like to know what do you have to change to use certain talkactions commands while having CONDITION_MUTED active And also, is there any function to set the direction of the player corresponding to the target, so if they are 2 squares above us, the direction of the player will change...
  15. M

    C++ function information

    Hi, in this link otland/forgottenserver you can see the function I need help with (just some explanation). There are 3 if statements that are important to me but I am just curious about 1 The first one will execute once you deselect the target by yourself. The third one will execute if you...
  16. M

    C++ passing Player* to function

    Hi, I somehow managed to do the onSelectTarget function in creaturescripts and its working great, so it will execute when player selects any target. But I am still stuck on the other part which is the OnDeselectTarget. To my game.cpp I have added the code in purple const auto& events =...
  17. M

    TFS 1.X+ CreatureScript target

    I need a function onSelectTarget(cid) and onDeselectTarget(cid, oldTarget) in creaturescripts to optimize my code even better and not sure if this already exists in TFS that's why I am writing it here. The first one would execute when player select any target. The other one when they decide to...
  18. M

    TFS 1.X+ Prevent player from throwing/trading item

    Is there a function to prevent player from throwing away or selling trading certain item? If not, how about could I do it using Tfs 1.0
  19. M

    TFS 1.X+ registerEvent

    Hi, Found this thread about modal windows, here: [How-to] Modal Windows And it involves registering and unregistering events for player. My question is whether the registered event will be unregistered automatically onDeath, consider this scenario from that thread above: 1. Player opens modal...
  20. M

    TFS 1.X+ condition_infight

    Hi, I want to print something to the console when the player is clicking on the item while being beaten up by monsters - that means the player will have that condition called INFIGHT. I did something like this, but it doesn't print anything function onUse(cid, item, fromPosition, target...
Back
Top