Apollos's best answers

  • Apollos

    TFS 1.X+ Help Channel message when open

    Window isn't fully open during onJoin so this message is being sent but won't be seen. Try this instead: function onJoin(player) addEvent(function(cid) local player = Player(cid) if not player then return end player:sendChannelMessage("", "MESSAGE"...
  • Apollos

    Add distanceeffect on spell

    local combat = Combat() combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE) combat:setParameter(COMBAT_PARAM_EFFECT, 16) combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true) combat:setParameter(COMBAT_PARAM_USECHARGES, true) combat:setArea(createCombatArea(AREA_CIRCLE3X3)) local combat2 =...
  • Apollos

    TFS 1.X+ onTradeRequest?

    It's in data/events/scripts/player.lua
  • Apollos

    OTClient Module doesnt load after restarting otclient

    Did you add it here too? edubart/otclient (https://github.com/edubart/otclient/blob/1addf3e1766ca3fe43bdf1114c0655a971123291/modules/game_interface/interface.otmod)
  • Apollos

    Help with this script

    From reading oen's thread I see you are not using onItemMoved like he specifies. If you set everything up correctly besides this, it's probably easier just to add the commit to your server for onItemMoved. Player:onItemMoved event (#2474) · otland/[email protected]
  • Apollos

    How i can make it?

    Untested, let me know how it works out. local offer_pos, reward_pos = Position(32342, 32236, 6), Position(32344, 32236, 6) local config = { [2154] = 2140, [2155] = 2137, } function onUse(player, item, fromPosition, target, toPosition, isHotkey) local tile = Tile(offer_pos) if...
  • Apollos

    Storage for equip actionid

    You need to use player instead of self here. Also I'm not 100% with onEquip/onDeEquip sure but you may just be able to register the action id in movements.xml instead of the itemid so you can exclude the getActionId check within. I think it may be better to just check slots of player when...
  • Apollos

    transforming item

    Best way is to do something like this: local transform_id = 2659 function onUse(player, item, fromPosition, target, toPosition, isHotkey) item:transform(transform_id) item:decay() return true end Then in items.xml you set a decayTo and duration on the item it transformed into that...
  • Apollos

    OTClient Idle Animations

    Animate always is for creatures like bonelord or fire elemental, where the idle and walking animations are the same. If you want it to have an idle animation and walking animation separate you need to have animations set up for both idle and walking. Although the idle animations are broken in...
  • Apollos

    TFS 1.2 Standing in specific tile/pos saying specific word triggers NPC Spawn

    talkactions/talkactions.xml <talkaction words="apple" script="hidden_npc.lua" /> talkactions/scripts/hidden_npc.lua local config = { npc_name = "Alice", npc_pos = Position(1000, 1001, 7), required_pos = Position(1000, 1000, 7), duration = 1 -- in minutes } function onSay(player...
  • Apollos

    Event onStepIn not found in movements

    This is assuming you are using TFS 1.X: No need to check for players position since you already have the fail pos declared. Looks like you made a typo with storage key 2632637 Player userdata is already in the function parameters, cid is used in older distros. Both fail positions can be...
  • Apollos

    Tfs 1.2 On level up gives full hp/mana

    Comment out these lines, just a few lines up from where Sun referenced. health = healthMax; mana = manaMax;
  • Apollos

    Passing tile only possible wearing specific item id TFS 1.2

    local required_armor = 2463 function onStepIn(creature, item, toPosition, fromPosition) local player = creature:getPlayer() if not player then return true end local armor = player:getSlotItem(CONST_SLOT_ARMOR) if not armor or armor.itemid ~= required_armor then...
  • Apollos

    Set x amount of items to craft.

    local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid)...
  • Apollos

    Wierd quest bugg

    Maybe there's a problem with isContainer func. Try changing to this line: local size = getContainerSize(item.uid) or 0
  • Apollos

    Killstreak give a spell

    You can try this: creaturescripts/creaturescripts.xml <event type="death" name="Kill_Streak" script="other/kill_streak.lua" /> creaturescripts/scripts/other/kill_streak.lua local kill_streak = {} -- DO NOT CHANGE local spell_name = "YOU CUSTOM SPELL NAME HERE" function onDeath(creature...
  • Apollos

    How do people pack .spr .dat into .exe

    Try Enigma Virtual Box, it's pretty self explanatory how to use it.
  • Apollos

    1 way Tile?

    I'm not too good at earlier version but you can try this: has_walked = has_walked or {} function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) if not isPlayer(cid) then return true end if has_walked[cid] then doTeleportThing(cid, lastPosition...
  • Apollos

    TFS 1.2 Damage

    The creaturescript event onHealthChange is an option. For your example you could do this: function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin) local player = creature:getPlayer() if player and primaryType ~= COMBAT_HEALING and...
  • Apollos

    Globalevent - Create and remove Wall from the map every two hours.

    Try this one out: local previous_key = previous_key or nil local walls_array = { [1] = {positions = {Position(1000, 1000, 7), Position(1000, 1000, 7)}, itemid = 25574}, [2] = {positions = {Position(1000, 1000, 7)}, itemid = 25574}, [3] = {positions = {Position(1000, 1000, 7)}, itemid...
Top