Hello.
Can someone convert this script. If vocation x add the effect x every 2 seconds
Code:function onThink(interval, lastExecution) if getPlayerVocation(cid) == 143 then doSendMagicEffect(getPlayerPosition(cid), 6) end end
function onThink(interval, lastExecution)
if getPlayerVocation(cid) == 143 then
doSendMagicEffect(getPlayerPosition(cid), 6)
elseif getPlayerVocation(cid) == xx then
doSendMagicEffect(getPlayerPosition(cid), x)
elseif getPlayerVocation(cid) == xx then
doSendMagicEffect(getPlayerPosition(cid), x)
elseif getPlayerVocation(cid) == xx then
doSendMagicEffect(getPlayerPosition(cid), x)
return true
end
end
<globalevent name="xxxx" interval="2000" event="script" value="xxxx.lua"/>
It doesn't work maybe first line is wrong?
function onThink(interval, lastExecution, thinkInterval)
function onThink(interval, lastExecution)
for _, name in ipairs(getOnlinePlayers()) do
local cid = getPlayerByName(name)
if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 5 then
doSendMagicEffect(getPlayerPosition(cid), 40)
elseif getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 6 then
doSendMagicEffect(getPlayerPosition(cid), 40)
elseif getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 7 then
doSendMagicEffect(getPlayerPosition(cid), 40)
elseif getPlayerVocation(cid) == 4 or getPlayerVocation(cid) == 8 then
doSendMagicEffect(getPlayerPosition(cid), 40)
end
end
return true
end
function onThink()
for _, cid in ipairs(getPlayersOnline()) do
if isInArray({1, 5}, getPlayerVocation(cid)) then
doSendMagicEffect(getThingPosition(cid), CONST_ME_BIGCLOUDS)
end
end
return true
end
LUA:function onThink() for _, cid in ipairs(getPlayersOnline()) do if isInArray({1, 5}, getPlayerVocation(cid)) then doSendMagicEffect(getThingPosition(cid), CONST_ME_BIGCLOUDS) end end return true end
he never specified if there's several vocations, so it's up to him to copypastewhat about different effects for different vocations?![]()