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

Hey ask for script for !bless tfs 1.2 tibia 10.100

Tehaceria Ots

New Member
Joined
Dec 4, 2017
Messages
14
Reaction score
0
Just like the subject.
I have this but don't work ;/

Code:
local bless = {1, 2, 3, 4, 5}
local cost = 50000 -- Cost in gp.
 
function onSay(cid, words, param)
    for i = 1, table.maxn(bless) do
        if(getPlayerBlessing(cid, bless[i])) then
            doPlayerSendCancel(cid, "You already have all blessings.")
            return TRUE
        end
    end
 
    if(doPlayerRemoveMoney(cid, cost) == TRUE) then
        for i = 1, table.maxn(bless) do
            doPlayerAddBlessing(cid, bless[i])
        end
        doPlayerSendTextMessage(cid,24, "You have bought all blessings.")
        doSendMagicEffect(getPlayerPosition(cid), 28)
    else
        doPlayerSendCancel(cid, "You don't have enough money.")
    end
    return TRUE
end
 
Solution
Try this one should work add to your talkactions bless.lua
Lua:
function onSay(cid)

    local player = Player(cid)
    local totalBlessPrice = getBlessingsCost(player:getLevel()) * 5 * 0.7

    if player:getBlessings() == 5 then
                player:sendCancelMessage("You already have been blessed!", cid)
            elseif player:removeMoney(totalBlessPrice) then
                player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been blessed by all of eight gods!")
                for b = 1, 8 do
                    player:addBlessing(b, 1)
                end
                player:getPosition():sendMagicEffect(CONST_ME_HOLYAREA)

            else
                player:sendCancelMessage("You don't have enough money. You...
How is it not working? Any errors?
Try this one

Lua:
function getCost(level)
    if level <= 30 then
        return 2000*5
    elseif level >= 120 then
        return 10000*5
    else
        return ((level - 20) * 200 * 5)
    end
end

function onSay(cid, words, param)
    local p = Player(cid)
    local cost = getCost(getPlayerLevel(cid))
    if(not(isPlayerPzLocked(cid))) then
        if(p:hasBlessing(1) and p:hasBlessing(2) and p:hasBlessing(3) and p:hasBlessing(4) and p:hasBlessing(5) and p:hasBlessing(6)) then
            p:sendCancelMessage("You have already been blessed by the gods.")
            return false
        end
        if(p:removeMoney(cost)) then
            for b = 1,6 do
                p:addBlessing(b)
            end
            p:getPosition():sendMagicEffect(39)
            p:sendTextMessage(19, "You have been blessed by the gods!")
        else
            p:sendCancelMessage("You need "..cost.." gold coins to buy all blessings.")
        end
    else
        p:sendCancelMessage("You can't buy bless, when you are in a battle.")
    end
return false
end
 
Yeah just like this
XML:
<talkaction words="!bless" script="bless.lua"/>
 
yes i have this and this lau
On ots if im writhe !bless have efect+17:02 You have been blessed by the gods!+take cc from bp.
and efect is 17:03 No blessings received. look with ornamented brooch
 
When you die you are losing loot/level like if you are not blessed?
Post your data\creaturescripts\scripts login.lua/droploot.lua
and config.lua
 
Okey
Config
Code:
-- Combat settings
-- NOTE: valid values for worldType are: "pvp", "no-pvp" and "pvp-enforced"
worldType = "pvp"
hotkeyAimbotEnabled = true
protectionLevel = 7
pzLocked = 60 * 1000
removeChargesFromRunes = true
removeChargesFromPotions = true
removeWeaponAmmunition = true
removeWeaponCharges = true
timeToDecreaseFrags = 45 * 24 * 60 * 60
whiteSkullTime = 15 * 60 * 1000
stairJumpExhaustion = 2 * 1000
experienceByKillingPlayers = false
expFromPlayersLevelRange = 75
dayKillsToRedSkull = 3
weekKillsToRedSkull = 5
monthKillsToRedSkull = 10
redSkullDuration = 30
blackSkullDuration = 45
orangeSkullDuration = 7

-- Connection Config
-- NOTE: maxPlayers set to 0 means no limit
-- NOTE: MaxPacketsPerSeconds if you change you will be subject to bugs by WPE, keep the default value of 25
ip = "127.0.0.1"
bindOnlyGlobalAddress = false
loginProtocolPort = 7171
gameProtocolPort = 7172
statusProtocolPort = 7171
maxPlayers = 0
motd = "Bem vindo ao Open-TibiaBR!"
onePlayerOnlinePerAccount = true
allowClones = false
serverName = "Open-TibiaBR"
statusTimeout = 5 * 1000
replaceKickOnLogin = true
maxPacketsPerSecond = 25
maxItem = 2000
maxContainer = 100

-- Version Manual
clientVersionMin = 1100
clientVersionMax = 1200
clientVersionStr = "Only support outdated 10.00 and version 12.00"

-- Depot Limit
freeDepotLimit = 2000
premiumDepotLimit = 10000
depotBoxes = 17

-- GameStore
gamestoreByModules = true

-- Quest Sytem
loadQuestLua = true

-- Expert Pvp Config
expertPvp = false

-- Deaths
-- NOTE: Leave deathLosePercent as -1 if you want to use the default
-- death penalty formula. For the old formula, set it to 10. For
-- no skill/experience loss, set it to 0.
deathLosePercent = -1

-- Houses
-- NOTE: set housePriceEachSQM to -1 to disable the ingame buy house functionality
housePriceEachSQM = 1000
houseRentPeriod = "never"

-- Item Usage
-- Do not touch here
-- Avoid use of WIPE program to crash the distro
timeBetweenActions = 500
timeBetweenExActions = 700

-- Map
-- NOTE: set mapName WITHOUT .otbm at the end
-- NOTE: unzip the map world.rar
mapName = "otservbr"
mapAuthor = "Open-TibiaBR"

-- Market
marketOfferDuration = 30 * 24 * 60 * 60
premiumToCreateMarketOffer = true
checkExpiredMarketOffersEachMinutes = 60
maxMarketOffersAtATimePerPlayer = 100

-- MySQL
mysqlHost = "127.0.0.1"
mysqlUser = "root"
mysqlPass = ""
mysqlDatabase = ""
mysqlPort = 3306
mysqlSock = ""

-- Misc.
allowChangeOutfit = true
freePremium = true
kickIdlePlayerAfterMinutes = 15
idleWarningTime = 10 * 60 * 1000
idleKickTime = 15 * 60 * 1000
maxMessageBuffer = 4
emoteSpells = false
classicEquipmentSlots = false
allowWalkthrough = true
coinPacketSize = 25
coinImagesURL = "http://localhost/images/store/"
classicAttackSpeed = false

-- Rates
-- NOTE: rateExp is not used if you have enabled stages in data/XML/stages.xml
rateExp = 1
rateSkill = 50
rateLoot = 3
rateMagic = 25
rateSpawn = 1

-- Monster rates
rateMonsterHealth = 1.0
rateMonsterAttack = 1.0
rateMonsterDefense = 1.0

-- Monsters
deSpawnRange = 2
deSpawnRadius = 50

-- Stamina
staminaSystem = true

-- Scripts
warnUnsafeScripts = true
convertUnsafeScripts = true

-- Startup
-- NOTE: defaultPriority only works on Windows and sets process
-- priority, valid values are: "normal", "above-normal", "high"
defaultPriority = "high"
startupDatabaseOptimization = true

-- Status server information
ownerName = "OTServBR-Global"
ownerEmail = ""
url = "https://github.com/opentibiabr/OTServBR-Global"
location = "South America"
droploot
Code:
function onDeath(player, corpse, killer, mostDamage, unjustified, mostDamage_unjustified)
    if getPlayerFlagValue(player, PlayerFlag_NotGenerateLoot) then --or player:getVocation():getId() == VOCATION_NONE then
        return true
    end

    local amulet = player:getSlotItem(CONST_SLOT_NECKLACE)
    if amulet and amulet.itemid == ITEM_AMULETOFLOSS and not isInArray({SKULL_RED, SKULL_BLACK}, player:getSkull()) then
        local isPlayer = false
        if killer then
            if killer:isPlayer() then
                isPlayer = true
            else
                local master = killer:getMaster()
                if master and master:isPlayer() then
                    isPlayer = true
                end
            end
        end

        if not isPlayer or not player:hasBlessing(5) then
            player:removeItem(ITEM_AMULETOFLOSS, 1, -1, false)
        end
    else
        for i = CONST_SLOT_HEAD, CONST_SLOT_AMMO do
            local item = player:getSlotItem(i)
            if item then
                if isInArray({SKULL_RED, SKULL_BLACK}, player:getSkull()) or math.random(item:isContainer() and 100 or 1000) <= player:getLossPercent() then
                    item:moveTo(corpse)
                end
            end
        end
    end

    if not player:getSlotItem(CONST_SLOT_BACKPACK) then
        local bag = player:addItem(ITEM_BAG, 1, false, CONST_SLOT_BACKPACK)
    end
    return true
end

and login
Code:
function Player.sendTibiaTime(self, hours, minutes)
    local msg = NetworkMessage()
    msg:addByte(0xEF)
    msg:addByte(hours)
    msg:addByte(minutes)
    msg:sendToPlayer(self)
    msg:delete()
    return true
end

local function onMovementRemoveProtection(cid, oldPosition, time)
    local player = Player(cid)
    if not player then
        return true
    end

    local playerPosition = player:getPosition()
    if (playerPosition.x ~= oldPosition.x or playerPosition.y ~= oldPosition.y or playerPosition.z ~= oldPosition.z) or player:getTarget() then
        player:setStorageValue(Storage.combatProtectionStorage, 0)
        return true
    end

    addEvent(onMovementRemoveProtection, 1000, cid, oldPosition, time - 1)
end

function onLogin(player)
    local loginStr = 'Welcome to ' .. configManager.getString(configKeys.SERVER_NAME) .. '!'
    if player:getLastLoginSaved() <= 0 then
        loginStr = loginStr .. ' Please choose your outfit.'
        player:sendOutfitWindow()
        player:setBankBalance(0)
    else
        if loginStr ~= "" then
            player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
        end

        loginStr = string.format('Your last visit was on %s.', os.date('%a %b %d %X %Y', player:getLastLoginSaved()))
    end

    player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)

    local playerId = player:getId()

    DailyReward.init(playerId)

    player:loadSpecialStorage()

    --[[-- Maintenance mode
    if (player:getGroup():getId() < 2) then
        return false
    else

    end--]]

    if (player:getGroup():getId() >= 4) then
        player:setGhostMode(true)
    end

    -- Stamina
    nextUseStaminaTime[playerId] = 1

    -- EXP Stamina
    nextUseXpStamina[playerId] = 1

    -- New Prey
    nextPreyTime[playerId] = {
        [CONST_PREY_SLOT_FIRST] = 1,
        [CONST_PREY_SLOT_SECOND] = 1,
        [CONST_PREY_SLOT_THIRD] = 1
    }

    if (player:getAccountType() == ACCOUNT_TYPE_TUTOR) then
        local msg = [[:: Tutor Rules
            1 *> 3 Warnings you lose the job.
            2 *> Without parallel conversations with players in Help, if the player starts offending, you simply mute it.
            3 *> Be educated with the players in Help and especially in the Private, try to help as much as possible.
            4 *> Always be on time, if you do not have a justification you will be removed from the staff.
            5 *> Help is only allowed to ask questions related to tibia.
            6 *> It is not allowed to divulge time up or to help in quest.
            7 *> You are not allowed to sell items in the Help.
            8 *> If the player encounters a bug, ask to go to the website to send a ticket and explain in detail.
            9 *> Always keep the Tutors Chat open. (required).
            10 *> You have finished your schedule, you have no tutor online, you communicate with some CM in-game or ts and stay in the help until someone logs in, if you can.
            11 *> Always keep a good Portuguese in the Help, we want tutors who support, not that they speak a satanic ritual.
            12 *> If you see a tutor doing something that violates the rules, take a print and send it to your superiors. "
            - Commands -
            Mute Player: / mute nick, 90. (90 seconds)
            Unmute Player: / unmute nick.
            - Commands -]]
        player:popupFYI(msg)
    end

     -- OPEN CHANNELS
    if table.contains({"Rookgaard", "Dawnport"}, player:getTown():getName())then
        player:openChannel(3) -- world chat
        player:openChannel(6) -- advertsing rook main
    else
        player:openChannel(3) -- world chat
        player:openChannel(5) -- advertsing main
    end

    -- Rewards
    local rewards = #player:getRewardList()
    if(rewards > 0) then
        player:sendTextMessage(MESSAGE_INFO_DESCR, string.format("You have %d %s in your reward chest.", rewards, rewards > 1 and "rewards" or "reward"))
    end

    -- Update player id
    local stats = player:inBossFight()
    if stats then
        stats.playerId = player:getId()
    end

     if player:getStorageValue(Storage.combatProtectionStorage) < 1 then
        player:setStorageValue(Storage.combatProtectionStorage, 1)
        onMovementRemoveProtection(playerId, player:getPosition(), 10)
    end

    -- Set Client XP Gain Rate
    if Game.getStorageValue(GlobalStorage.XpDisplayMode) > 0 then
        displayRate = Game.getExperienceStage(player:getLevel())
        else
        displayRate = 1
    end
    local staminaMinutes = player:getStamina()
    local storeBoost = player:getExpBoostStamina()
    player:setStoreXpBoost(storeBoost > 0 and 50 or 0)
    if staminaMinutes > 2400 and player:isPremium() and storeBoost > 0 then
        player:setBaseXpGain(displayRate*2*100) -- Premium + Stamina boost + Store boost
        player:setStaminaXpBoost(150)
    elseif staminaMinutes > 2400 and player:isPremium() and storeBoost <= 0 then
        player:setBaseXpGain(displayRate*1.5*100) -- Premium + Stamina boost
        player:setStaminaXpBoost(150)
    elseif staminaMinutes <= 2400 and staminaMinutes > 840 and player:isPremium() and storeBoost > 0 then
        player:setBaseXpGain(displayRate*1.5*100) -- Premium + Store boost
        player:setStaminaXpBoost(100)
    elseif staminaMinutes > 840 and storeBoost > 0 then
        player:setBaseXpGain(displayRate*1.5*100) -- FACC + Store boost
        player:setStaminaXpBoost(100)
    elseif staminaMinutes <= 840 and storeBoost > 0 then
        player:setBaseXpGain(displayRate*1*100) -- ALL players low stamina + Store boost
        player:setStaminaXpBoost(50)
    elseif staminaMinutes <= 840 then
        player:setBaseXpGain(displayRate*0.5*100) -- ALL players low stamina
        player:setStaminaXpBoost(50)
    end

    if player:getClient().version > 1110 then
        local worldTime = getWorldTime()
        local hours = math.floor(worldTime / 60)
        local minutes = worldTime % 60
        player:sendTibiaTime(hours, minutes)
    end
    
    if player:getStorageValue(Storage.isTraining) == 1 then -- redefinir storage de exercise weapon
        player:setStorageValue(Storage.isTraining,0)
    end
    return true
end
 
Try adding this login then test bless
Lua:
function Player.sendTibiaTime(self, hours, minutes)
    local msg = NetworkMessage()
    msg:addByte(0xEF)
    msg:addByte(hours)
    msg:addByte(minutes)
    msg:sendToPlayer(self)
    msg:delete()
    return true
end

local function onMovementRemoveProtection(cid, oldPosition, time)
    local player = Player(cid)
    if not player then
        return true
    end

    local playerPosition = player:getPosition()
    if (playerPosition.x ~= oldPosition.x or playerPosition.y ~= oldPosition.y or playerPosition.z ~= oldPosition.z) or player:getTarget() then
        player:setStorageValue(Storage.combatProtectionStorage, 0)
        return true
    end

    addEvent(onMovementRemoveProtection, 1000, cid, oldPosition, time - 1)
end

function onLogin(player)
    local loginStr = 'Welcome to ' .. configManager.getString(configKeys.SERVER_NAME) .. '!'
    if player:getLastLoginSaved() <= 0 then
        loginStr = loginStr .. ' Please choose your outfit.'
        player:sendOutfitWindow()
        player:setBankBalance(0)
    else
        if loginStr ~= "" then
            player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
        end

        loginStr = string.format('Your last visit was on %s.', os.date('%a %b %d %X %Y', player:getLastLoginSaved()))
    end

    player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)

    local playerId = player:getId()

    DailyReward.init(playerId)

    player:loadSpecialStorage()

    --[[-- Maintenance mode
    if (player:getGroup():getId() < 2) then
        return false
    else

    end--]]

    if (player:getGroup():getId() >= 4) then
        player:setGhostMode(true)
    end

    -- Stamina
    nextUseStaminaTime[playerId] = 1

    -- EXP Stamina
    nextUseXpStamina[playerId] = 1

    -- New Prey
    nextPreyTime[playerId] = {
        [CONST_PREY_SLOT_FIRST] = 1,
        [CONST_PREY_SLOT_SECOND] = 1,
        [CONST_PREY_SLOT_THIRD] = 1
    }

    if (player:getAccountType() == ACCOUNT_TYPE_TUTOR) then
        local msg = [[:: Tutor Rules
            1 *> 3 Warnings you lose the job.
            2 *> Without parallel conversations with players in Help, if the player starts offending, you simply mute it.
            3 *> Be educated with the players in Help and especially in the Private, try to help as much as possible.
            4 *> Always be on time, if you do not have a justification you will be removed from the staff.
            5 *> Help is only allowed to ask questions related to tibia.
            6 *> It is not allowed to divulge time up or to help in quest.
            7 *> You are not allowed to sell items in the Help.
            8 *> If the player encounters a bug, ask to go to the website to send a ticket and explain in detail.
            9 *> Always keep the Tutors Chat open. (required).
            10 *> You have finished your schedule, you have no tutor online, you communicate with some CM in-game or ts and stay in the help until someone logs in, if you can.
            11 *> Always keep a good Portuguese in the Help, we want tutors who support, not that they speak a satanic ritual.
            12 *> If you see a tutor doing something that violates the rules, take a print and send it to your superiors. "
            - Commands -
            Mute Player: / mute nick, 90. (90 seconds)
            Unmute Player: / unmute nick.
            - Commands -]]
        player:popupFYI(msg)
    end

     -- OPEN CHANNELS
    if table.contains({"Rookgaard", "Dawnport"}, player:getTown():getName())then
        player:openChannel(3) -- world chat
        player:openChannel(6) -- advertsing rook main
    else
        player:openChannel(3) -- world chat
        player:openChannel(5) -- advertsing main
    end

    -- Rewards
    local rewards = #player:getRewardList()
    if(rewards > 0) then
        player:sendTextMessage(MESSAGE_INFO_DESCR, string.format("You have %d %s in your reward chest.", rewards, rewards > 1 and "rewards" or "reward"))
    end

    -- Update player id
    local stats = player:inBossFight()
    if stats then
        stats.playerId = player:getId()
    end

     if player:getStorageValue(Storage.combatProtectionStorage) < 1 then
        player:setStorageValue(Storage.combatProtectionStorage, 1)
        onMovementRemoveProtection(playerId, player:getPosition(), 10)
    end

    -- Set Client XP Gain Rate
    if Game.getStorageValue(GlobalStorage.XpDisplayMode) > 0 then
        displayRate = Game.getExperienceStage(player:getLevel())
        else
        displayRate = 1
    end
    local staminaMinutes = player:getStamina()
    local storeBoost = player:getExpBoostStamina()
    player:setStoreXpBoost(storeBoost > 0 and 50 or 0)
    if staminaMinutes > 2400 and player:isPremium() and storeBoost > 0 then
        player:setBaseXpGain(displayRate*2*100) -- Premium + Stamina boost + Store boost
        player:setStaminaXpBoost(150)
    elseif staminaMinutes > 2400 and player:isPremium() and storeBoost <= 0 then
        player:setBaseXpGain(displayRate*1.5*100) -- Premium + Stamina boost
        player:setStaminaXpBoost(150)
    elseif staminaMinutes <= 2400 and staminaMinutes > 840 and player:isPremium() and storeBoost > 0 then
        player:setBaseXpGain(displayRate*1.5*100) -- Premium + Store boost
        player:setStaminaXpBoost(100)
    elseif staminaMinutes > 840 and storeBoost > 0 then
        player:setBaseXpGain(displayRate*1.5*100) -- FACC + Store boost
        player:setStaminaXpBoost(100)
    elseif staminaMinutes <= 840 and storeBoost > 0 then
        player:setBaseXpGain(displayRate*1*100) -- ALL players low stamina + Store boost
        player:setStaminaXpBoost(50)
    elseif staminaMinutes <= 840 then
        player:setBaseXpGain(displayRate*0.5*100) -- ALL players low stamina
        player:setStaminaXpBoost(50)
    end

    if player:getClient().version > 1110 then
        local worldTime = getWorldTime()
        local hours = math.floor(worldTime / 60)
        local minutes = worldTime % 60
        player:sendTibiaTime(hours, minutes)
    end
    
    if player:getStorageValue(Storage.isTraining) == 1 then -- redefinir storage de exercise weapon
        player:setStorageValue(Storage.isTraining,0)
    end
    player:registerEvent("DropLoot")
    return true
end
 
Try this one should work add to your talkactions bless.lua
Lua:
function onSay(cid)

    local player = Player(cid)
    local totalBlessPrice = getBlessingsCost(player:getLevel()) * 5 * 0.7

    if player:getBlessings() == 5 then
                player:sendCancelMessage("You already have been blessed!", cid)
            elseif player:removeMoney(totalBlessPrice) then
                player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been blessed by all of eight gods!")
                for b = 1, 8 do
                    player:addBlessing(b, 1)
                end
                player:getPosition():sendMagicEffect(CONST_ME_HOLYAREA)

            else
                player:sendCancelMessage("You don't have enough money. You need " .. totalBlessPrice .. " to buy bless.", cid)
            end
end
 
Solution
Bless script has nothing to do with your equip, We didn't edit source files or any other files we only added Talkactions script.
There should be something else which did this bug, If you added my login.lua remove it and add your original one back then retest.
Lua:
function Player.sendTibiaTime(self, hours, minutes)
    local msg = NetworkMessage()
    msg:addByte(0xEF)
    msg:addByte(hours)
    msg:addByte(minutes)
    msg:sendToPlayer(self)
    msg:delete()
    return true
end

local function onMovementRemoveProtection(cid, oldPosition, time)
    local player = Player(cid)
    if not player then
        return true
    end

    local playerPosition = player:getPosition()
    if (playerPosition.x ~= oldPosition.x or playerPosition.y ~= oldPosition.y or playerPosition.z ~= oldPosition.z) or player:getTarget() then
        player:setStorageValue(Storage.combatProtectionStorage, 0)
        return true
    end

    addEvent(onMovementRemoveProtection, 1000, cid, oldPosition, time - 1)
end

function onLogin(player)
    local loginStr = 'Welcome to ' .. configManager.getString(configKeys.SERVER_NAME) .. '!'
    if player:getLastLoginSaved() <= 0 then
        loginStr = loginStr .. ' Please choose your outfit.'
        player:sendOutfitWindow()
        player:setBankBalance(0)
    else
        if loginStr ~= "" then
            player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
        end

        loginStr = string.format('Your last visit was on %s.', os.date('%a %b %d %X %Y', player:getLastLoginSaved()))
    end

    player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)

    local playerId = player:getId()

    DailyReward.init(playerId)

    player:loadSpecialStorage()

    --[[-- Maintenance mode
    if (player:getGroup():getId() < 2) then
        return false
    else

    end--]]

    if (player:getGroup():getId() >= 4) then
        player:setGhostMode(true)
    end

    -- Stamina
    nextUseStaminaTime[playerId] = 1

    -- EXP Stamina
    nextUseXpStamina[playerId] = 1

    -- New Prey
    nextPreyTime[playerId] = {
        [CONST_PREY_SLOT_FIRST] = 1,
        [CONST_PREY_SLOT_SECOND] = 1,
        [CONST_PREY_SLOT_THIRD] = 1
    }

    if (player:getAccountType() == ACCOUNT_TYPE_TUTOR) then
        local msg = [[:: Tutor Rules
            1 *> 3 Warnings you lose the job.
            2 *> Without parallel conversations with players in Help, if the player starts offending, you simply mute it.
            3 *> Be educated with the players in Help and especially in the Private, try to help as much as possible.
            4 *> Always be on time, if you do not have a justification you will be removed from the staff.
            5 *> Help is only allowed to ask questions related to tibia.
            6 *> It is not allowed to divulge time up or to help in quest.
            7 *> You are not allowed to sell items in the Help.
            8 *> If the player encounters a bug, ask to go to the website to send a ticket and explain in detail.
            9 *> Always keep the Tutors Chat open. (required).
            10 *> You have finished your schedule, you have no tutor online, you communicate with some CM in-game or ts and stay in the help until someone logs in, if you can.
            11 *> Always keep a good Portuguese in the Help, we want tutors who support, not that they speak a satanic ritual.
            12 *> If you see a tutor doing something that violates the rules, take a print and send it to your superiors. "
            - Commands -
            Mute Player: / mute nick, 90. (90 seconds)
            Unmute Player: / unmute nick.
            - Commands -]]
        player:popupFYI(msg)
    end

     -- OPEN CHANNELS
    if table.contains({"Rookgaard", "Dawnport"}, player:getTown():getName())then
        player:openChannel(3) -- world chat
        player:openChannel(6) -- advertsing rook main
    else
        player:openChannel(3) -- world chat
        player:openChannel(5) -- advertsing main
    end

    -- Rewards
    local rewards = #player:getRewardList()
    if(rewards > 0) then
        player:sendTextMessage(MESSAGE_INFO_DESCR, string.format("You have %d %s in your reward chest.", rewards, rewards > 1 and "rewards" or "reward"))
    end

    -- Update player id
    local stats = player:inBossFight()
    if stats then
        stats.playerId = player:getId()
    end

     if player:getStorageValue(Storage.combatProtectionStorage) < 1 then
        player:setStorageValue(Storage.combatProtectionStorage, 1)
        onMovementRemoveProtection(playerId, player:getPosition(), 10)
    end

    -- Set Client XP Gain Rate
    if Game.getStorageValue(GlobalStorage.XpDisplayMode) > 0 then
        displayRate = Game.getExperienceStage(player:getLevel())
        else
        displayRate = 1
    end
    local staminaMinutes = player:getStamina()
    local storeBoost = player:getExpBoostStamina()
    player:setStoreXpBoost(storeBoost > 0 and 50 or 0)
    if staminaMinutes > 2400 and player:isPremium() and storeBoost > 0 then
        player:setBaseXpGain(displayRate*2*100) -- Premium + Stamina boost + Store boost
        player:setStaminaXpBoost(150)
    elseif staminaMinutes > 2400 and player:isPremium() and storeBoost <= 0 then
        player:setBaseXpGain(displayRate*1.5*100) -- Premium + Stamina boost
        player:setStaminaXpBoost(150)
    elseif staminaMinutes <= 2400 and staminaMinutes > 840 and player:isPremium() and storeBoost > 0 then
        player:setBaseXpGain(displayRate*1.5*100) -- Premium + Store boost
        player:setStaminaXpBoost(100)
    elseif staminaMinutes > 840 and storeBoost > 0 then
        player:setBaseXpGain(displayRate*1.5*100) -- FACC + Store boost
        player:setStaminaXpBoost(100)
    elseif staminaMinutes <= 840 and storeBoost > 0 then
        player:setBaseXpGain(displayRate*1*100) -- ALL players low stamina + Store boost
        player:setStaminaXpBoost(50)
    elseif staminaMinutes <= 840 then
        player:setBaseXpGain(displayRate*0.5*100) -- ALL players low stamina
        player:setStaminaXpBoost(50)
    end

    if player:getClient().version > 1110 then
        local worldTime = getWorldTime()
        local hours = math.floor(worldTime / 60)
        local minutes = worldTime % 60
        player:sendTibiaTime(hours, minutes)
    end
    
    if player:getStorageValue(Storage.isTraining) == 1 then -- redefinir storage de exercise weapon
        player:setStorageValue(Storage.isTraining,0)
    end
    return true
end
 
Try this one and please create another thread next time when you have a different question to be easier for others who have same request/issue to find it.
add this to your data\globalevents\scripts as autosave.lua
Lua:
local cleanMapAtSave = true

local function serverSave()
    if cleanMapAtSave then
        --cleanMap()
    Game.broadcastMessage('Server Saved, next save in 1 hour.', MESSAGE_STATUS_WARNING)
    end

    saveServer()
end

function onThink(interval)
    Game.broadcastMessage('Server Save within 30 seconds, may cause a little freeze, do not worry.', MESSAGE_STATUS_WARNING)
    addEvent(serverSave, 60000)
    return true
end
then add in your globalevents.xml
XML:
<globalevent interval="3600000" name="AutoSave" script="autosave.lua"/>
 
Back
Top