• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

ZOMBIE EVENT-DICE CASINO-WAR ANTIENTROSA

viking

Member
Joined
Aug 20, 2015
Messages
323
Reaction score
22
Hello i dont find this events working ont tfs 1;2

who have it and can help? :D
 
I was tryed, I was try to update this, but got erros, I was posted here in forum and nobody was help with my change, look original script:

Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function onPlayerEndTrade(cid) npcHandler:onPlayerEndTrade(cid) end
function onPlayerCloseChannel(cid) npcHandler:onPlayerCloseChannel(cid) end
local function delayMoneyRemoval(item, pos)
    doRemoveItem(getTileItemById(pos, item).uid)
    return true
end
local function placeMoney(amount, table_middle_pos)
    local remain = amount
    local crystal_coins = 0
    local platinum_coins = 0
    if (math.floor(amount / 10000) >= 1) then
        crystal_coins = math.floor(amount / 10000)
        remain = remain - crystal_coins * 10000
    end
    if ((remain / 100) >= 1) then
        platinum_coins = remain / 100
    end
    addEvent(doCreateItem, 550, 2152, platinum_coins, table_middle_pos)
    addEvent(doCreateItem, 600, 2160, crystal_coins, table_middle_pos)
end
local function rollDice(roll, cc_count, pc_count, table_left_pos, table_middle_pos, npc)
    local dice_ids = {5792, 5793, 5794, 5795, 5796, 5797}
    local random_rollval = math.random(1,6)
    local total_g = (10000 * cc_count) + (100 * pc_count)
    local prize_percent = 0.8 -- 80%
    if ((total_g) <= 300000 and (total_g) >= 5000) then
        doSendMagicEffect(table_left_pos, CONST_ME_CRAPS)
        for _, itemId in pairs(dice_ids) do
                if(getTileItemById(table_left_pos, itemId).uid > 0) then
                doTransformItem(getTileItemById(table_left_pos, itemId).uid, dice_ids[random_rollval])
            end
        end
        if (roll == 1 and random_rollval <= 3) then
            placeMoney(total_g + (total_g * prize_percent), table_middle_pos)
            addEvent(doSendMagicEffect, 400, table_left_pos, CONST_ME_SOUND_GREEN)
            addEvent(doSendMagicEffect, 700, table_left_pos, CONST_ME_SOUND_GREEN)
            addEvent(doCreatureSay, 500, npc, "You win!", TALKTYPE_SAY, false, 0)
        elseif (roll == 2 and random_rollval >= 4) then
            placeMoney(total_g + (total_g * prize_percent), table_middle_pos)
            addEvent(doSendMagicEffect, 400, table_left_pos, CONST_ME_SOUND_GREEN)
            addEvent(doSendMagicEffect, 700, table_left_pos, CONST_ME_SOUND_GREEN)
            addEvent(doCreatureSay, 500, npc, "You win!", TALKTYPE_SAY, false, 0)
        else
            addEvent(doSendMagicEffect, 400, table_left_pos, CONST_ME_BLOCKHIT)
            addEvent(doSendMagicEffect, 700, table_left_pos, CONST_ME_BLOCKHIT)
            addEvent(doCreatureSay, 500, npc, "Better luck next time.", TALKTYPE_SAY, false, 0)
        end
        doCreatureSay(npc, string.format("%s rolled a %d.", getCreatureName(npc), random_rollval), TALKTYPE_ORANGE_1, false, 0, table_left_pos)
    else
        addEvent(doCreateItem, 100, 2160, cc_count, table_middle_pos)
        addEvent(doCreateItem, 150, 2152, pc_count, table_middle_pos)
        doCreatureSay(npc, "The minimum wager is 5K and the maximum wager is 300K.", TALKTYPE_SAY, false, 0)
    end
    return true
end
function creatureSayCallback(cid, type, msg)
-- NPC userdata instance
local npc = Npc(getNpcCid())

-- Participating player userdata instance
local position = npc:getPosition() + {x = 32002, y = 31898, z = 7}
position.stackpos = STACKPOS_TOP_CREATURE
local player_uid = getThingfromPos(position).uid

-- Game table position userdata instances
local table_left_pos = Position(32000, 31897, 7)
local table_middle_pos = Position(32001, 31897, 7)

-- Search for coins on the left and middle tables and create item userdata instances
local table_left_cc_uid = getTileItemById(table_left_pos, 2160).uid
local table_middle_cc_uid = getTileItemById(table_middle_pos, 2160).uid
local table_left_pc_uid = getTileItemById(table_left_pos, 2152).uid
local table_middle_pc_uid = getTileItemById(table_middle_pos, 2152).uid

-- Other variables
local cc_count = 0
local pc_count = 0
local ROLL, LOW, HIGH = 0, 1, 2
    if (player_uid ~= 0) then
        if ((msgcontains(string.lower(msg), 'high') or msgcontains(string.lower(msg), 'h')) and (isPlayer(player_uid) and player_uid == cid)) then
            ROLL = HIGH
        elseif ((msgcontains(string.lower(msg), 'low') or msgcontains(string.lower(msg), 'l')) and (isPlayer(player_uid) and player_uid == cid)) then
            ROLL = LOW
        else
            return false
        end
        if (table_middle_cc.uid ~= 0) then
            cc_count = table_middle_cc.type
            doTeleportThing(table_middle_cc.uid, table_left_pos)
            addEvent(delayMoneyRemoval, 300, 2160, table_left_pos)
        end
        if (table_middle_pc.uid ~= 0) then
            pc_count = table_middle_pc.type
            doTeleportThing(table_middle_pc.uid, table_left_pos)
            addEvent(delayMoneyRemoval, 300, 2152, table_left_pos)
        end
        addEvent(rollDice, 500, ROLL, cc_count, pc_count, table_left_pos, table_middle_pos, npc)
    else
        return false
    end
    return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
 
You get a lot of help from people all the time, you should change your attitude and be patient, or learn how to script...

Bro what is your problem? Why you come here to say this? I do not need your opinion of my actions . And if you do not want to help , do not come here for flooding threads, just dont help like you doing.
 
You could just consolidate all your threads into a simple "Need a fully working server with tons of custom features for TFS 1.2 Free PLIX"

wtf you are dumb or what? Here is forum for "REQUEST", or are you blind or something? please leave my posts and avoid thereby flood dumb.
 
wtf you are dumb or what? Here is forum for "REQUEST", or are you blind or something? please leave my posts and avoid thereby flood dumb.
Hey asshole the people who write scripts on this board do it out of the kindness of their heart, I write scripts or help people with their scripts only if they are respectful to others, keep acting like a douche bag and see how much help you get from this community.
 
Back
Top