local config = {
positions = {
{pos = { x =32345, y =32228, z= 4 }, text = "Dragons", effects = {CONST_ME_MAGIC_BLUE}},
{pos = {x = 32350,y = 32230,z = 4 }, text = "Trainer"}
},
effects = {CONST_ME_POFF, CONST_ME_TELEPORT, CONST_ME_MAGIC_RED}
}
function onThink(interval)
local people = getPlayersOnline()
if #people == 0 then
return true
end
for _, info in pairs(config.positions) do
doPlayerSay(people[1], 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
<globalevent name="talkingSigns" interval="4000" script="talking.lua"/>
local config = {
positions = {
{pos = {x = 100, y = 120, z = 7}, text = "Dragons", effects = {CONST_ME_MAGIC_BLUE}},
{pos = {x = 101, y = 120, z = 7}, text = "Trainer"}
},
effects = {CONST_ME_POFF, CONST_ME_TELEPORT, CONST_ME_MAGIC_RED}
}
function onThink(interval)
local people = getOnlinePlayers()
if #people == 0 then
return true
end
for _, info in pairs(config.positions) do
doCreatureSay(getPlayerByName(people[1]), info.text, TALKTYPE_ORANGE_1, 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
doCreatureSay(getPlayerByName(people[1]), info.text, TALKTYPE_ORANGE_1, false, 0, info.pos)
for p = 1, #people do
doCreatureSay(getPlayerByName(people[p]), info.text, TALKTYPE_ORANGE_1, false, 0, info.pos)
...
Lua Script Error: [GlobalEvent Interface]
data/globalevents/scripts/talking.lua:onThink
data/globalevents/scripts/talking.lua:9: attempt to call global 'getOnlinePlayers' (a nil value)
stack traceback:
[C]: in function 'getOnlinePlayers'
data/globalevents/scripts/talking.lua:9: in function <data/globalevents/scripts/talking.lua:8>
[Error - GlobalEvents::think] Failed to execute event: talkingSigns
getOnlinePlayers() > Game.getPlayers()Hello I tried the edit on 1.1 TFS, eventhough its all in compat.lua wrote like this, it colidates with anything :/
Code:Lua Script Error: [GlobalEvent Interface] data/globalevents/scripts/talking.lua:onThink data/globalevents/scripts/talking.lua:9: attempt to call global 'getOnlinePlayers' (a nil value) stack traceback: [C]: in function 'getOnlinePlayers' data/globalevents/scripts/talking.lua:9: in function <data/globalevents/scripts/talking.lua:8> [Error - GlobalEvents::think] Failed to execute event: talkingSigns
local config = {
positions = {
{pos = {x = 32358, y = 32241, z = 7}, text = "VIP ZONE!"}
},
effects = {CONST_ME_POFF, CONST_ME_TELEPORT, CONST_ME_MAGIC_RED}
}
function onThink(interval)
local people = Game.getPlayers()
if #people == 0 then
return true
end
for _, info in pairs(config.positions) do
doCreatureSay(getPlayerByName(people[1]), info.text, TALKTYPE_ORANGE_1, 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
Didnt fix the problem
my script:
Code:local config = { positions = { {pos = {x = 32358, y = 32241, z = 7}, text = "VIP ZONE!"} }, effects = {CONST_ME_POFF, CONST_ME_TELEPORT, CONST_ME_MAGIC_RED} } function onThink(interval) local people = Game.getPlayers() if #people == 0 then return true end for _, info in pairs(config.positions) do doCreatureSay(getPlayerByName(people[1]), info.text, TALKTYPE_ORANGE_1, 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
Lua Script Error: [GlobalEvent Interface]
data/globalevents/scripts/tpeffect.lua:onThink
data/globalevents/scripts/tpeffect.lua:17: attempt to call global 'getPlayerByName' (a nil value)
stack traceback:
[C]: in function 'getPlayerByName'
data/globalevents/scripts/tpeffect.lua:17: in function <data/globalevents/scripts/tpeffect.lua:10>
[Error - GlobalEvents::think] Failed to execute event: talkingSigns