Bogart's best answers

  • Bogart

    TFS 1.X+ Delete description of an item, partially

    You should post the code bruh, but here's how you should do it, I guess you can figure out the rest str = "You see a sword. Created by PlayerName. [HP+15]" --this should be item:getAttribute(ITEM_ATTRIBUTE_DESCRIPTION) str = str:gsub('%b[]', '') print(str) --this should be...
  • Bogart

    TFS 1.X+ Debug effect talkaction

    function onSay(cid, words, param) local player = Player(cid) if not player:getGroup():getAccess() then return true end if player:getAccountType() < ACCOUNT_TYPE_GOD then return false end local params = param:split(" ") if params[3] == nil then...
  • Bogart

    Color background

    You shouldn't tag people, it's quite rude. If you're using the tibiacom layout open layouts/tibiacom/basic.css and change line #4 from background-color: #061222; to background-color: #000;
  • Bogart

    Lua need a little help with create random items in random positions

    Use "created" instead of "itemsrand", but after the loop.
  • Bogart

    TFS 1.X+ Few questions - housing

    I believe a global event would be the most appropiate solution since a player could buy a house and then never login again, so onLogin won't do the deed. local vip_storage = 1000 local houses = Game.getHouses() for i = 1, #houses do local house = houses[i] local owner...
  • Bogart

    TFS 1.X+ Modifying spell script

    Nvm, just replace it in line 425 instead of the whole script
  • Bogart

    Lua Ring of Ending

    local storage = 480658 local storage2 = 480663 local messages = { {m = "The ring feels quite heavy now. Nothing else happens.", e = CONST_ME_MAGIC_GREEN}, {m = "The ring feels even heavier. You feel slightly stronger, however.", e = CONST_ME_MAGIC_GREEN}, {m = "You feel better, more...
  • Bogart

    (A few more) noob GM questions

    Yeah, well the first point you can change in your config.lua file, find: removeChargesFromRunes = true removeChargesFromPotions = true change those values to false the spawn rates can be changed in there too rateSpawn = 1 Health and mana regen can be changed in (not sure if it can be changed...
  • Bogart

    Tables actionsid in lua? Checking condition in lop.

    Well if you want to trigger an action when levers are in a certain order: local lever_trans = { [1945] = 1946, [1946] = 1945 } local levers = { {Position(104, 129, 7), 1945}, --lever position, desired id (1945 lever to the left, 1946 lever to the right) {Position(104, 130, 7)...
  • Bogart

    Check parameters |Linux->Bash

    `mkdir ~/Desktop/$1`
  • Bogart

    Lua My NPC don't respond to 'yes'

    At line 34 on NPC 2 and 3 you had else return false end Basically, if the if on line 18 wasn't true, the npc would stop talking to the player because of the return false, so I just removed the else and the return false from the script so it would continue with the rest of the valid words. on...
  • Bogart

    Lua Help: Don't allow to carry more than certain amount of an item

    function Player:onMoveItem(item, count, fromPosition, toPosition, fromCylinder, toCylinder) local itemid = 2160 local maxcount = 50 if toPosition.x == 65535 then if item:isContainer() then count = searchInContainer(item, itemid) end if...
  • Bogart

    Lua Raid Daays

    if tonumber(os.date("%d")) == 20 then
  • Bogart

    Lua Item for random teleport

    change cid to cid.uid in addEvent.
  • Bogart

    Lua Npc Bank

    Lel, that's because its only the if, you need to change the variable that the script will use: below local function creatureSayCallback(cid, type, msg) add msg = msg:match("^%s*(.-)%s*$") and remove it from the if, it is no longer needed.
  • Bogart

    Convert tfs 0.4 script to 1.2

    function onStepIn(cid, item, pos) if item.uniqueid == 8000 then doPlayerSetGuildId(cid, 3, 1) end end function doPlayerSetGuildId(cid, guildId, rank) local playerId = getPlayerGUID(cid) db.query("INSERT INTO `guild_membership` (`player_id`, `guild_id`, `rank_id`) VALUES...
  • Bogart

    Lua Drowning condition not dissapearing after stepOut

    remove "not" from line 17
  • Bogart

    magic level up full mana

    If you want to remove the mana refill after advancing on magic level (this is what I understood): function onAdvance(cid, skill, oldlevel, newlevel) local pos = getCreaturePosition(cid) if skill == SKILL__LEVEL then doCreatureAddHealth(cid, getCreatureMaxHealth(cid))...
  • Bogart

    Lua KD count unjustified

    function onKill(creature, target) if creature:isPlayer() and target:isPlayer() and not Tile(creature:getPosition()):hasFlag(TILESTATE_PVPZONE) then creature:say("+1 Kill", TALKTYPE_ORANGE_1) creature:setStorageValue(167912, math.max(0, creature:getStorageValue(167912)) +...
  • Bogart

    Solved How to get time left to X hour.

    See a bunch of useless posts in this thread, if you're not helpful just don't post lol. Anyway, I believe there should be a better way to do it, but here's my attempt: function timeForHour(hour) local time = (string.split(hour, ":")[1]*60) + string.split(hour, ":")[2] local current =...
Top