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

having problems with broadcast and tile script! need help!

MikeG

New Member
Joined
Jul 1, 2013
Messages
23
Reaction score
2
Having problems with two lua scripts.
Im using TFS 0.3.7
Im obviously not a pro but atleast im trying ... so help me please :)

Broadcast script.
I need this script to broadcast a message at a certain time and day of the week. However it doesnt work.

Code:
<globalevent name="bcmessage" time="2:23" event="script" value="bcmessage.lua"/>
Code:
local config =
{
    days        = {"Sunday"},
}

function onTime()
    if not isInArray(config.days, os.date("%A")) then
        return true
    end
end
   
function onThink()
if(isInArray(config.days)) then
        doBroadcastMessage("The event is starting in 5 mintues!!!!")
    end
end

Tile script.
Only players with a certain item can walk on the tile, while everyone else cant. That is the purpose of this tile script. However it doesnt work, i set the action id on the certain sqm on remere's map editor too.

Code:
local config = {
    itemid = 8931,
    amount = 1
}


function onStepIn(cid, item, position, fromPosition)
    if getPlayerItemCount(cid, config.itemid, config.amount) then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, you need a special item.")
       
        doTeleportThing(cid, fromPosition, false)
        doSendMagicEffect(position, CONST_ME_MAGIC_BLUE)
    else
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Welcome!")
    end
    return true
end
 
Code:
local config = {
     days = {"Sunday"}
}

function onTimer()
       if isInArray(config.days, os.date("%A")) then
            doBroadcastMessage("The event is starting in 5 mintues!!!!")
       end
       return true
end

Code:
if getPlayerItemCount(cid, config.itemid) < config.amount then
 

Similar threads

Back
Top