Can someone help me to make the distance effect working?
my script:
thats the error im getting...
TFS 0.4
my script:
Lua:
local text = {
--X pos,Y pos, Z pos, text
[1] = {pos = {2000,2000,7}, text = {"WELCOME!"}},
[2] = {pos = {4994,4999,7}, text = {"Monsters!"}},
[3] = {pos = {4994,5000,7}, text = {"Quests!"}},
[4] = {pos = {989,989,7}, text = {"Arena!"}},
[5] = {pos = {4994,5001,7}, text = {"Trainers!"}},
[6] = {pos = {989,991,7}, text = {"Items!"}},
[7] = {pos = {5006,4999,7}, text = {"Events!"}},
[8] = {pos = {5006,4998,7}, text = {"City 1!"}},
[9] = {pos = {5006,4997,7}, text = {"City 2!"}},
[10] = {pos = {5006,5000,7}, text = {"RL City!"}},
[11] = {pos = {5006,5001,7}, text = {"Items!"}},
[12] = {pos = {4994,4997,7}, text = {"Don Shop!"}},
}
local effects = {
--X pos,Y pos, Z pos, text
[1] = {pos = {2000,2000,7}, effect = {37}},
[2] = {pos = {4994,5000,7}, effect = {37}},
[3] = {pos = {4994,4999,7}, effect = {37}},
[4] = {pos = {4994,4998,7}, effect = {37}},
[5] = {pos = {4994,4997,7}, effect = {37}},
[6] = {pos = {5006,4997,7}, effect = {37}},
[7] = {pos = {5006,4998,7}, effect = {37}},
[8] = {pos = {5006,4999,7}, effect = {37}},
[9] = {pos = {5006,5000,7}, effect = {37}},
[10] = {pos = {5006,5001,7}, effect = {37}},
}
function onThink(interval, lastExecution)
for _, area in pairs(text) do
doSendAnimatedText({x=area.pos[1],y=area.pos[2],z=area.pos[3]},area.text[1], math.random(210,210))
end
for _, area in pairs(effects) do
doSendMagicEffect({x=area.pos[1],y=area.pos[2],z=area.pos[3]},area.effect[1])
end
local pos = getThingPos(cid)
doSendDistanceShoot({x=pos.x+2,y=pos.y+2,z=pos.z},pos, CONST_ANI_HOLY)
doSendDistanceShoot({x=pos.x+2,y=pos.y-2,z=pos.z},pos, CONST_ANI_HOLY)
doSendDistanceShoot({x=pos.x-2,y=pos.y-2,z=pos.z},pos, CONST_ANI_HOLY)
doSendDistanceShoot({x=pos.x-2,y=pos.y+2,z=pos.z},pos, CONST_ANI_HOLY)
return true
end
thats the error im getting...
Code:
[23:33:42.985] [Error - GlobalEvent Interface]
[23:33:42.987] data/globalevents/scripts/effects.lua:onThink
[23:33:42.988] Description:
[23:33:42.990] data/globalevents/scripts/effects.lua:51: attempt to index local 'pos' (a boolean value)
[23:33:42.991] stack traceback:
[23:33:42.992] data/globalevents/scripts/effects.lua:51: in function <data/globalevents/scripts/effects.lua:43>
[23:33:42.993] [Error - GlobalEvents::think] Couldn't execute event: effects
TFS 0.4