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.
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.
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