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

NPC Visual Gambler NPC [TFS 1.x]

henkas

Active Member
Joined
Jul 8, 2015
Messages
872
Solutions
4
Reaction score
40
It has a bug if you stack 100gold and you win it still becomes 100
 

luanluciano1993

Active Member
Joined
Aug 1, 2017
Messages
7
Reaction score
30
Lua:
    for _, item in ipairs(Tile(dicePosition):getItems()) do
        local itemId = item:getId()
        if not isInArray({5792, 5793, 5794, 5795, 5796, 5797}, itemId) and ItemType(itemId):isMovable() then
            item:remove()
        end
    end

wouldn't that be better?
Lua:
    for _, item in ipairs(Tile(dicePosition):getItems()) do
        local itemId = item:getId()
        if table.contains({ITEM_GOLD_COIN, ITEM_PLATINUM_COIN, ITEM_CRYSTAL_COIN, ITEM_BLOCKING}, itemId) then
            item:moveTo(Position(npcPosition.x + 2, npcPosition.y - 1, npcPosition.z))
        elseif not table.contains({5792, 5793, 5794, 5795, 5796, 5797}, itemId) and ItemType(itemId):isMovable() then
            item:remove()
        end
    end
 

Nooba007

New Member
Joined
Jul 10, 2008
Messages
23
Reaction score
2
having error while tyring to run this script, anyone have any clues why?

in function 'getNpcPos' data/npc/scripts/dicegamble2.lua:75: in function 'callback' data/npc/lib/npcsystem/npchandler.lua:431: in function 'onCreatureSay' data/npc/scripts/dicegamble2.lua:7: in function <data/npc/scripts/dicegamble2.lua:7>
 

Fablow

Intermediate OT User
Content Editor
Joined
May 7, 2008
Messages
1,569
Solutions
6
Reaction score
133
Location
Canada
GitHub
Fablow77
God Mythera's works on TFS 1.3 tested.
having error while tyring to run this script, anyone have any clues why?

in function 'getNpcPos' data/npc/scripts/dicegamble2.lua:75: in function 'callback' data/npc/lib/npcsystem/npchandler.lua:431: in function 'onCreatureSay' data/npc/scripts/dicegamble2.lua:7: in function <data/npc/scripts/dicegamble2.lua:7>

Find:
Lua:
local position = {x = getNpcPos().x+2, y = getNpcPos().y, z = getNpcPos().z}

Replace with:
Lua:
local position = {x = XXX, y = XXX, z = XXX} --position of where the player will be standing
 
Top