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

lua

  1. B

    Solved Help with Loot Slots

    Hello OTLand Community. I've downloaded the latest version of OTServBR (Version 12) and have a trouble with slots on corpses loot. Here i go: 1. In items.xml, "slain demon" is configured with this line: <attribute key="containerSize" value="24" /> 2. Then, when i kill any Demon, i have only 15...
  2. demon088

    Lua Spells with charges

    Hello again OtLand! I need some assistance making a new series of spells for my OTS, and if someone would like to use it, I'm glad to explain how it works or help to insert or edit the spell. My team had the idea to make a spell which could get one charge each time you use it. So, if you have...
  3. Lurk

    Lua onThink function help

    Hello, I'm working in this script, tfs 0.4 8.6 function onThink(cid, interval) local rate = 1.15 -- só access local ratering42 = 3.15 -- ring 200 com acces local origratering42 = 3.0 -- ring 200 sem access local ratering41 = 2.45 -- ring 130 com access local origratering41 = 2.3 -- ring 130 sem...
  4. Togu

    [OTClient] How to add new lua libraries?

    So, I want to create a button on client that download a file from internet, I need the "socket" library for that, I tried using socker = require("socket") on terminal on cliente but received: ERROR: command failed: :1: module 'socket' not found: no module 'socket' no field...
  5. C

    Why this login script doesn't work?

    Why is this script not working? I want a simple script that set the player town to 2 when he login for the first time. I am making sure to create a new char to make the LastLoginSaved = 0, still doesn't work. creaturescripts.xml <event type="login" name="changetown"...
  6. kozmo

    TFS 1.X+ 1.3 Auto Looting Help

    I am using TFS 1.3 OTServBr-Global. With the modal auto looter i have no errors accept it wont pick up items and not sure why, In TFS 1.2 Otxserver it works the same but will loot monsters. No src files used in this. If someone could help me out that would be great thanks for reading.
  7. Ovnyx

    TFS 1.X+ Validate item when using

    hi people, i was trying to validate when i use an object in a target what kind of item is(helmet, legs, armor, ring, etc) i tried with ItemType using itemType:getSlotPosition() with no success any ideas how can i do this? thanks in advice!
  8. tekadon2

    TFS 1.X+ Function that checks if the player is approaching X area

    A few hours ago I was trying to create a function in which it returns the player's proximity to a certain place as a percentage. Example: Player 70% to go to X position. It would be something like this. No need returns with the% sign just the value is enough. Thank you :)
  9. Lurk

    TFS 0.X player dying and reseting to level 1

    Hello, I was using this script function onPrepareDeath(cid, lastHitKiller, mostDamageKiller) if isPlayer(cid) == true then if (getPlayerSlotItem(cid, 2).itemid == 10134) then pos = getCreaturePos(cid) doCreatureSetDropLoot(cid, false) doPlayerSetLossPercent(cid, experience, 0)...
  10. M

    Lua help me script

    function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerVocation(cid) == 5 then doPlayerAddItem(cid, 3966) doPlayerAddItem(doPlayerAddItem(cid, 2275) doPlayerSendTextMessage(cid,19,"XD") doSendAnimatedText(getThingPos(cid), "Yeah Exp With I...
  11. Lurk

    TFS 0.X Always war shield

    hello, I want everyone in my server to always have the shield emblem on their character (that one of guild wars) and I know that adding this on my login.lua if getPlayerGuildId(cid) > 0 then local guild = getPlayerGuildId(cid) doGuildAddEnemy(guild, enemy, 0, WAR_GUILD)...
  12. thalmonn

    Help to translate this code!

    Hello folks! I'm not a expert on dev otserver, so in this moment i'm trying to "convert" this code to a new version. This script is write to work on tfs 0.4 (i think) on a otserver 7.92. I need to convert him to a tfs 1.2 params, to do the same thing as the original version. I need to run it on...
  13. Lurk

    TFS 0.X hundred of onCreatureLeave messages on console

    each second there's at least 30, listing npcs and monsters, there's also "Monster: monstername not found in the friendList." [19:24:33.332] Monster: Cond Jumy not found in the friendList. [19:24:33.332] onCreatureLeave - Cond Jumy I'm trying this TFS 1.X+ - tfs 1.2 how can i create a crash log...
  14. Lurk

    Lua Npc can only but 30 at a time

    Hello, I have a tfs 0.4 server and whenever a player has excessive items in containers (bcakpacks) and sell more than 40 at a time to a npc it will causes lag, probably because it has to check every slot in the player backpack idk, is there a way to limit the amount of itens the npc can buy at a...
  15. Znote

    [TFS 1.3] [Revscriptsys] Free Lua scripting service - Post your requests! Let's learn it together!

    What is revscriptsys? Revscriptsys is a new way to register your scripts in an easy drag and drop way without the need to register it with xml. Basically you just place your .lua file into data/scripts/ or any subfolder according to your taste, except for monster files, they go into...
  16. V

    Lua.hpp Error in Visual Studio 2017

    http://prntscr.com/op5cl0 So everything worked fine - compiling was working without any issues until now. I don't really know what to do with this error. Can anyone explain me what to do? I'm kinda lost. :(
  17. kuhi

    Lua onKill not working with test script?

    I'm trying to make an onKill event script just for learning: function onKill(cid, target, lastHit) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "On script") return true end It's very simple, and I don't know why it's not working... no errors in console neither other...
  18. A

    Script Npc: doPlayerAddItem

    Hi, im copy a code from npc sell items but if i buy amount less than 20. used 2 slot in inventory and bought four instead of two i bought 10 small healt potion and used 5 slot in bag my question is how can I use only 1 slot. if i bought 2 health in bag appear as 4 Sorry for my bad...
  19. changx

    Lua Attempt to call local 'callback' (a nil value)

    Hello! The first time I used lua, I encountered this mistake and didn't know how to solve it. Thank you for your help. I used torch7 cudnn7 lua5.2 Here's my runtime error /home/jm/torch/install/bin/lua: /home/jm/torch/install/share/lua/5.2/nn/Module.lua:352: attempt to call local 'callback' (a...
  20. V

    Script request

    Good morning, I've tried writing a code, however could not make it work. My codding skills are below basic. I need a script that makes the player say a specific sentence once the monster health hit a certain percentage. For example, if a Juggernaut hits the 30% HP mark, the player will use a...
Back
Top