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

function

  1. ZeroSkyer

    Lua Reduce level

    Hello, any tip to make a function to reduce the level of x player, with life and mana according to the level and of type condition, that is not anything related to altering the db? I know it's very difficult :(, thanks in advance.
  2. Yan18

    TFS 1.X+ [TFS 1.3] What Function Is Equivalente to onAttack or onCombat from TFS 0.X?

    Hello guys! I would like to know what function I can use to get Attacker and Target in combat to set target. I tried use the function Creature: onTargetCombat(target) from file creature.lua but it didn't work. I need to set target from monsters to my summons instead me when I have a summon. I...
  3. beenii

    Lua create function shuffle(numbers)

    Hello I think that interesting systems could be created with a function like this I need it for a system to change townid of my players the truth is, I don't know how to store data in tables, to create this function the idea of the function is the following: be able to use the function...
  4. S

    TFS 1.X+ player add item

    Hi i'm having some trouble with the lua function player:addItem, if the user have the main backpack full, the item dosent appear in the ground or in the other backpacks
  5. Togu

    TFS 1.X+ Lua lib functions in NPC

    I have this functions in data/lib/core/skillpoints.lua And they are all working with modal window system. But I want to use the player:resetAllSkills() on a NPC. I've tried but it didn't recognize the function. I know I could copy the code of the function to the npc file, but I want to...
  6. elnelson

    C++ [0.4] doAbsorbCombatPercentage and getCombatPercentageAbsorbed

    Hello, otlanders. i found a code patch for tfs 0.4 but when i try to compile it i got this error lines: In member function 'virtual void LuaInterface::registerFunctions()': 1709 D:\OTS\trunk.3777.r12\sources\luascript.cpp 'luaDoAbsorbCombatPercentage' is not a member of 'LuaInterface' 1709...
  7. Caduceus

    Solved Account Storage Funcion

    I know that their are several Account storage functions floating around. None of which work. When I try to use this function as player:getAccountStorage() I am getting an error in console as player is a nil value on line "local playerAccount = player:getAccountId()". Player is defined above, I...
  8. Mummrik

    [0.3.6] lua function doCreatureAddCurse(cid, minDmgValue, maxTicks, dmgDelay)

    This is my method to replicate the curse system, since i didnt find it on my server. defalut useage = doCreatureAddCurse(cid, 1, 36, 4000) that means you cant use lower values than the ones i show, unless you modify the function. but it is however possible to use higher values minDmgValue =...
  9. N

    Solved tfs 0.3.6 and now 1.2, doplayer say and others

    Hello how can i make doplayer say, or addevent and say in talktype_orange_1 in tfs 1.2? Ok all know without addevent any ideas? Here is my code, local combat = Combat() combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) combat:setParameter(COMBAT_PARAM_EFFECT, 77)...
  10. bok

    AAC function rowcount

    <?php if ($action == ""){ $main_content .=' <div class="InnerTableContainer"> <table style="width:100%;"> <tbody> <tr> <td> <div class="TableShadowContainerRightTop"> <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);"> </div>...
  11. L

    onBlock/blockHit function?

    I don't really now scripting but i wanted to know if it is possible to get something like this If a player has a shield and successfully blocked an attack do X And if it is please teach me how to do it or just make an example, im trying to learn .lua and understand c++
  12. bok

    AAC Conver

    I needed to convert this script to Gesior 2012 is showing the error: Fatal error: Call to a member function fetch() $v = $SQL->query("SELECT (SELECT COUNT(`death_id`) FROM `killers` k LEFT JOIN `player_killers` pk ON `k`.`id` = `pk`.`kill_id` LEFT JOIN `players` p ON...
  13. L

    Lua Change health of summon.

    Is there any function in tfs 1.2 equivalent to "setHealth ()" Example usage Local health = [556] Monster: setHealth (health)
  14. A

    Lua changing /commands modal

    hey guys, everytime we use /commands, pop up an modal windows with all spells that char can use. i want make some style in this window and add some components like buttons or checkboxes.... i know the function called is 'DoShowTextDialog'. but in this function i not see anything about style...
  15. Colandus

    mapArea iterator

    Hey. This is a revised version of my old mapArea iterator. This simplifies looping through areas. My old iterator was a bit more confusing for developers who might have wanted to edit the iterator function itself. This time it's using coroutines so the function should be very easily...
  16. Colandus

    parseAreaMap - extract positions from "map" table

    This function will convert a table like this: local areaMap = { {1,2,0,2,1}, {2,0,0,0,2}, {0,0,3,0,0}, {2,0,0,0,2}, {1,2,0,2,1} } Into this: { [1] = { {x=-2, y=-2}, {x=2, y=-2}, {x=2, y=2}, {x=-2, y=2} }, [2] = { {x=-2, y=-1}...
  17. K

    2 Functions

    Hi there, I am curious if you can actually write 2 functions in one line because it could save me huge amount of work. My current code is: function onLogout(cid) if (getPlayerVocation(cid) == 1) then doCreatureChangeOutfit(cid, {lookType=549}) return 1 end I was trying to...
  18. Colandus

    Repeating events EASIER

    ----------------- -- By Colandus -- _CONT = {} function continue(delay, n, ...) local func = debug.getinfo(2).func if(not _CONT[func]) then _CONT[func] = true addEvent(repeatContinue, delay, func, delay, n, ...) end end function repeatContinue(func, delay, n, ...)...
  19. Colandus

    Teleport players from area (optionally offline)

    Teleport players from a certain area to a new position... Also has the option to teleport offline players. Usage is simple: doTeleportPlayersFromArea(fromPos, toPos, newPos, offlinePlayers --[[ = false]]) set offlinePlayers to true to enable offline players teleport!! do -- Function by...
  20. Colandus

    A few useful functions (CHECK!)

    -- Returns the top item on a tile. function getTopItem(pos) pos.stackpos = 1 + getTopCreature(pos).itemid return getTileThingByPos(pos) end -- Teleport a creature with effects, invisible players will not show effects! function doTeleportCreature(cid, pos, pushmove) if(not...
Back
Top