local config = {
positions = {
{pos = {x = 851, y = 972, z = 7}, text = "Hello Sir! How are you?", effects = {CONST_ME_MAGIC_BLUE}},
{pos = {x = 855, y = 972, z = 7}, text = "How are you?"}
},
effects = {CONST_ME_POFF, CONST_ME_TELEPORT, CONST_ME_MAGIC_RED}
}
function onThink(interval)
local speaker = getCreatureByName('Speaker Monster')
for _, info in pairs(config.positions) do
doPlayerSay(speaker, info.text, TALKTYPE_MONSTER_SAY, false, 0, info.pos)
if info.effects and #info.effects > 0 then
doSendMagicEffect(info.pos, info.effects[math.random(#info.effects)])
elseif config.effects and #config.effects > 0 then
doSendMagicEffect(info.pos, config.effects[math.random(#config.effects)])
end
end
return true
end
i get this error can someone help please?
[06/07/2013 18:35:38] Lua Script Error: [GlobalEvent Interface]
[06/07/2013 18:35:38] data/globalevents/scripts/talksign.luanThink
[06/07/2013 18:35:38] data/globalevents/scripts/talksign.lua:10: attempt to call global 'getPlayersOnline' (a nil value)
[06/07/2013 18:35:38] stack traceback:
[06/07/2013 18:35:38] [C]: in function 'getPlayersOnline'
[06/07/2013 18:35:38] data/globalevents/scripts/talksign.lua:10: in function <data/globalevents/scripts/talksign.lua:9>
[06/07/2013 18:35:38] [Error - GlobalEvents::think] Failed to execute event: talksign
This work for 10.78? TFS 1.2?
This is for 1.x, totally different version, search for talking signs for 0.2.I tried many variations from different posts, none of them worked
I'm using TFS 0.2.15 (Mystic Spirit) With client 9.86.
Any Idea how to make this work?
<globalevent name="talkingSigns" interval="2000" script="other/talkingSigns.lua"/>
local talkingSigns = {
["Trainer"] = Position(30100, 30200, 7)
}
function onThink(interval, lastExecution)
local people = getOnlinePlayers()
if #people == 0 then
return true
end
for message, tpPos in pairs(talkingSigns) do
local creature = Creature(people[1])
if creature then
creature:say(message, TALKTYPE_MONSTER_SAY, false, 0, tpPos)
end
end
return true
end
local talkingSigns = {
["Depot's"] = { Position(92, 131, 7), CONST_ME_MAGIC_BLUE },
["Trainer's"] = { Position(90, 133, 7), CONST_ME_MAGIC_GREEN }
}
local talkingEvent = GlobalEvent("TalkingSigns")
function talkingEvent.onThink(interval)
local players = Game.getPlayers()
if #players > 0 then
for sign, info in pairs(talkingSigns) do
players[1]:say(sign, TALKTYPE_MONSTER_YELL, false, 0, info[1])
info[1]:sendMagicEffect(info[2])
end
end
return true
end
talkingEvent:interval(4000)
talkingEvent:register()
Beat me too it lolBy RevScript Method!
directory: data/scripts/
file: talkingSigns.lua
Lua:local talkingSigns = { ["Depot's"] = { Position(92, 131, 7), CONST_ME_MAGIC_BLUE }, ["Trainer's"] = { Position(90, 133, 7), CONST_ME_MAGIC_GREEN } } local talkingEvent = GlobalEvent("TalkingSigns") function talkingEvent.onThink(interval) local players = Game.getPlayers() if #players > 0 then for sign, info in pairs(talkingSigns) do players[1]:say(sign, TALKTYPE_MONSTER_YELL, false, 0, info[1]) info[1]:sendMagicEffect(info[2]) end end return true end talkingEvent:interval(4000) talkingEvent:register()