• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua addEvent problem ((luaAddEvent) Callback parameter should be a function.)

Xibecaman

New Member
Joined
Aug 17, 2010
Messages
8
Reaction score
0
Hello,

I created an event and only runs once :S.. I think it is for error (luaAddEvent) Callback parameter should be a function.. ¿This error Stop event?

I paste my code here..

(all is on one file)
Event:
Code:
function prova(cid)
		--Efectes
			--FOC
				posx = getPlayerPosition(cid).x+1
				posy = getPlayerPosition(cid).y
				posz = getPlayerPosition(cid).z
				coor = {x = posx, y = posy , z = posz}			
				doSendMagicEffect(coor, 15)
				
				posx = getPlayerPosition(cid).x-1
				posy = getPlayerPosition(cid).y
				posz = getPlayerPosition(cid).z
				coor = {x = posx, y = posy , z = posz}			
				doSendMagicEffect(coor, 15)
				
				posx = getPlayerPosition(cid).x
				posy = getPlayerPosition(cid).y+1
				posz = getPlayerPosition(cid).z
				coor = {x = posx, y = posy , z = posz}			
				doSendMagicEffect(coor, 15)

				posx = getPlayerPosition(cid).x
				posy = getPlayerPosition(cid).y-1
				posz = getPlayerPosition(cid).z
				coor = {x = posx, y = posy , z = posz}			
				doSendMagicEffect(coor, 15)
end


Script:
Code:
local control = true
local posx
local posy
local pos7
local coor

function onEquip(cid, item, slot)
	if item.itemid == 7385 then
		if getPlayerGroupId(cid) == 6 then
		
		[B]local efectes = addEvent(prova(cid),5000)[/B]

		else
			doPlayerSendTextMessage(cid,21,"You can't")
			doCreatureAddHealth(cid, -getCreatureHealth(cid)) --Mort
			control = false
	end
	end
	return control
end

Thanks for all people :D!
 
cause events are default repeating only one
add addEvent(prova,5000,cid) to prova function too if you want to create an unlimited loop
 
Back
Top