Xikini's best answers

  • Xikini

    othire 0.0.3 problem with script actions

    change if item.itemid == 1878 and getPlayerStorageValue(cid,13340) < 0 then if item.itemid == 1878 and getPlayerStorageValue(cid,13340) <= 0 then
  • Xikini

    mudança no código

    I don't recommend removing items before checking that all the items are available. Otherwise it'll remove the first set of items, and then fail on the second set, causing the player to lose items without any reward. Try this instead. function onSay(cid, words, param) if...
  • Xikini

    Lua cancel countdown on battle.

    Why do you keep using that broken loop I told you to stop using? lol You are creating THOUSANDS of addevents because of that, when the entire purpose of using the external function is so you don't have all of those extra addEvents running. local function countDown2(number, cid) if not...
  • Xikini

    Action custom health potion

    local cfg = { level = 16, -- minimum level to use item magic = 16, -- minimum magic level to use item min = 1750, max = 1800, vocation = {26} -- {1, 2, 3} -- vocations that can use item } function onUse(cid, item, fromPosition, itemEx, toPosition) -- check vocation...
  • Xikini

    Problem with UH script

    Try this, and show us a screenshot of the console. local exhaust = createConditionObject(CONDITION_EXHAUST) setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 1000)) function onUse(cid, item, fromPosition, itemEx, toPosition) local mlevel =...
  • Xikini

    Lua tfs 0.4 (lua) check if a storage id exist on anyplayer

    Quick example if getGlobalStorageValue(45001) <= 0 then -- starting event setGlobalStorageValue(45001, 1) elseif getGlobalStorageValue(45001) == 1 then -- joining existing event end setPlayerStorageValue(cid, 45001, 1) -- note that global and player storages are separate, so they can...
  • Xikini

    on the quest of the spider cult

    I guess you'd just want to update the storage value each time you smash an egg. Put this around line 19. local storage = getPlayerStorageValue(cid, 12652) if storage >= 1 and storage <= 4 then setPlayerStorageValue(cid, 12652, storage + 1) end
  • Xikini

    Npc give one of four storage (random)

    if getPlayerStorageValue(cid, 9999) == 10 then local rand_storage = math.random(4) + 9994 -- 9995/6/7/8 setPlayerStorageValue(cid, rand_storage, 1) setPlayerStorageValue(cid, 9999, 11) if getPlayerStorageValue(cid, 9995) == 1 then -- jack elseif...
  • Xikini

    onUse Function

    change if not getPlayerItemCount(cid, parts[i]) then to if getPlayerItemCount(cid, parts[i]) < 1 then
  • Xikini

    Help with working script

    Sorry, forgot to adjust that part. Re-copy. I edited my post above.
  • Xikini

    Lua Block action item in Protection Zone

    function onUse(cid, item, fromPosition, itemEx, toPosition) if getTileInfo(getThingPos(cid)).protection or getTileInfo(getThingPos(itemEx.uid)).protection then doPlayerSendCancel(cid, "You can't use this item in Protection Zone.") return true end if item.itemid ==...
  • Xikini

    Lua [0.4] Deconstruct kit.

    aid shouldn't be required. Just deconstruct the items back into the normal construction kits.
  • Xikini

    Lua function onPrepareDeath error

    When a player reaches the 'PrepareDeath' stage, the character is already dead. If you return false, it will keep the character in-game, but the character won't be alive. If you are wanting to 'revive' the player without killing them, use 'onStatsChange' and check the damage being applied to the...
  • Xikini

    Bosses room

    Untested, but should work as expected. -- <movevent type="StepIn" actionid="111111111111111111111111" event="script" value="boss_room_xikini.lua"/> -- actionid needs to be placed onto the "Tile to enter boss room". local config = { -- this controls where the script will check for players...
  • Xikini

    TFS 0.X Action script is passing through walls

    isSightClear(fromPos, toPos, floorCheck)
  • Xikini

    Summoning monster on level

    you've added extra parameters to doSummonCreature doSummonCreature(name, pos) -------- Change this local clone = doSummonCreature(cid, cloneName, pos) to this local clone = doSummonCreature(cloneName, pos)
  • Xikini

    Npc Death

    Yes, it's possible. if msgcontains(msg, "kill") and talkState[talkUser] == 0 then selfSay("Please tell me the name of the person you want to kill.", cid) talkState[talkUser] = 1 elseif talkState[talkUser] == 1 then for _, pid in ipairs(getPlayersOnline()) do if msg:lower()...
  • Xikini

    Lua Getting values from LUA Tables.

    Worked via teamviewer with elnelson to find a good solution to his overall problem. To the original question he posed in this thread self.type.items[1][1] -- itemid self.type.items[1][2] -- count This was the answer.
  • Xikini

    Lua [0.4] Stackpos item.

    change all doTransformItem(getThingfromPos(toPosition).uid to doTransformItem(itemEx.uid
  • Xikini

    Lua stopEvent on logout.

    Stop event is only useful if you are using it for something that doesn't require a creatureID. Such as removing and re-adding a wall after x amount of seconds, where the trigger for this wall addition / removal can be triggered from two separate locations. In order to stop an event, the event...
Top