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

Request - Update player broadcast talkaction to TFS1.3

Taurus

Texass
Joined
Jan 11, 2009
Messages
616
Solutions
2
Reaction score
30
Location
United States
I would like if this script could work in 1.3, I'm sure some others could find it useful also.

I am trying to make it work, but I have never done this.

(The script is not mine... came from a datapack I found.)

Lua:
Local config = { 
storage = 19400, - storage in which time will be saved color 
= "advance", - according to constant.lua da lib 
time = 2, - in minutes 
price = 1000, - price for use or broadcast 
level = 100 - level pra to use or broadcast 
} 


function onSay (cid, words, param, channel) 
if (param == '') then 
doPlayerSendTextMessage (cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") 
return true 
End 


if getPlayerLevel (cid)> = config.level then 
if getPlayerStorageValue (cid, config.storage) - os.time () <= 0 then 
if doPlayerRemoveMoney (cid, config.price) then 
setPlayerStorageValue (cid, config.storage, .time () + (config.(Cid, MESSAGE_EVENT_DEFAULT, "You have successfully sent a broadcast, now 
.") 
"Do. You'll have to wait "..config.tempo .." minute (s) until you broadcast again. ") 
Else 
doPlayerSendCancel (cid," You do not have "..config.price .." gp's for broadcasting. ") 
return true 
end 
else 
doPlayerSendCancel (cid," You have to wait ".. (getPlayerStorageValue (cid, config.storage) - os.time ()) ..". seconds Until you can broadcast again ") 
return true 
end 
else 
DoPlayerSendCancel (cid, "You have to be level" ..config.Level .. "or more in order to use broadcast.") 
End 
end
 
Solution
I'm not good at this, but I will try (msg like GM: /b):

Lua:
local config = {
storage = 19400, --time storage
exhtime = 1 * 60, -- time 1=1min
price = 1000, -- price for use or broadcast
level = 100 -- level pra to use or broadcast
}


function onSay(player, words, param)
local timetobr = player:getStorageValue(config.storage)-os.time()
    if (param == '') then
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
    elseif player:getLevel() < config.level then
            player:SendCancelMessage(cid, "You have to be level "..config.Level.." or more in order to use broadcast.")
    elseif player:getStorageValue(config.storage) > os.time() then
            player:sendTextMessage(MESSAGE_STATUS_SMALL...
I'm not good at this, but I will try (msg like GM: /b):

Lua:
local config = {
storage = 19400, --time storage
exhtime = 1 * 60, -- time 1=1min
price = 1000, -- price for use or broadcast
level = 100 -- level pra to use or broadcast
}


function onSay(player, words, param)
local timetobr = player:getStorageValue(config.storage)-os.time()
    if (param == '') then
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
    elseif player:getLevel() < config.level then
            player:SendCancelMessage(cid, "You have to be level "..config.Level.." or more in order to use broadcast.")
    elseif player:getStorageValue(config.storage) > os.time() then
            player:sendTextMessage(MESSAGE_STATUS_SMALL, "You have to wait "..timetobr.."seconds until you can broadcast again.")
    elseif player:getMoney() < config.price then
                player:sendTextMessage(MESSAGE_STATUS_SMALL, "You do not have "..config.price.." gold for broadcasting.")
    return true
    end
        player:removeMoney(config.price)
        player:setStorageValue(config.storage, os.time() + config.exhtime)
            print("> " .. player:getName() .. " broadcasted: \"" .. param .. "\".")
    for _, targetPlayer in ipairs(Game.getPlayers()) do
        targetPlayer:sendPrivateMessage(player, param, TALKTYPE_BROADCAST)
    end
    return true
end
or this version (msg only in chat window):
Lua:
local config = {
storage = 19400, --time storage
exhtime = 2 * 60, -- time 1=1min
price = 1000, -- price for use or broadcast
level = 100 -- level pra to use or broadcast
}


function onSay(player, words, param)
local timetobr = player:getStorageValue(config.storage)-os.time()
    if (param == '') then
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
    elseif player:getLevel() < config.level then
            player:SendCancelMessage(cid, "You have to be level "..config.Level.." or more in order to use broadcast.")
    elseif player:getStorageValue(config.storage) > os.time() then
            player:sendTextMessage(MESSAGE_STATUS_SMALL, "You have to wait "..timetobr.."seconds until you can broadcast again.")
    elseif player:getMoney() < config.price then
                player:sendTextMessage(MESSAGE_STATUS_SMALL, "You do not have "..config.price.." gold for broadcasting.")
    return true
    end
        player:removeMoney(config.price)
        player:setStorageValue(config.storage, os.time() + config.exhtime)
        Game.broadcastMessage("" .. player:getName() .. " broadcasted: " .. param .. ".")
    return true
end
 
Last edited:
Solution
Back
Top