CesarZ
Well-Known Member
- Joined
- Sep 20, 2012
- Messages
- 269
- Solutions
- 4
- Reaction score
- 63
Hello guys i'm trying to add the "interval" parameter so they can work with different timing.
this script is the Talk-sings script.
My script that im working on
the result of this one is = one is working but the other talk-sing is giving me a
attempt to call local 'interval' (a number value) error
let me know what i did wrong im pretty new with lua arrays im trying to learn this.
this script is the Talk-sings script.
Lua:
--Normal script.
local t = {
{"", {x = 781, y = 1002, z = 6}, 73},
{"", {x = 777, y = 995, z = 7}, 73},
{"", {x = 777, y = 1001, z = 8}, 73},
{"", {x = 762, y = 1002, z = 7}, 73}
}
function onThink(interval)
local people = getOnlinePlayers()
if #people == 0 then
return true
end
for i = 1, #t do
local v = t[i]
doCreatureSay(people[1], v[1], TALKTYPE_ORANGE_1, false, 0, v[2])
doSendMagicEffect(v[2], v[3])
end
return true
end
My script that im working on
Lua:
local t = {
--{"", {x = 781, y = 1002, z = 6}, 73},
-- {"", {x = 777, y = 995, z = 7}, 73},
--{"", {x = 777, y = 1001, z = 8}, 73},
{"", {x = 742, y = 992, z = 9}, 73, 500}, -- interval setted 4th slot
{"", {x = 746, y = 992, z = 9}, 73, 900} -- interval setted 4th slot
--{"", {x = 762, y = 1002, z = 7}, 73}
}
function onThink(interval)
local people = getOnlinePlayers()
if #people == 0 then
return true
end
for i = 1, #t do
local v = t[i]
doCreatureSay(people[1], v[1], TALKTYPE_ORANGE_1, false, 0, v[2], v[4]) -- v[4] added so it work with interval.
doSendMagicEffect(v[2], v[3], v[4]) -- v[4] added so it can work with interval.
interval(v[4]) -- interval option added
end
return true
end
the result of this one is = one is working but the other talk-sing is giving me a
attempt to call local 'interval' (a number value) error
let me know what i did wrong im pretty new with lua arrays im trying to learn this.