• 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!

doSendMagicEffect ...

Haaan

New Member
Joined
Oct 24, 2009
Messages
56
Reaction score
0
8.54

hello icreate this script and this not work:
local max = 1200
local efekt = 136

function onSay(cid, words, param)
local count = 0
param = {cid = cid, count = 0}
addEvent(AddEffect, 250, param)

end

function AddEffect(param)
doSendMagicEffect(getPlayerPosition(cid), efekt)
param.count = param.count + 1
if param.count <= max then
addEvent(AddEffect, 250, param)
end
end

So i want to you help me, i need

function onSay
doSendMagicEffect(playerpos.x+1, playerpos.y, playerpos.z, efekt)(i dont know what "command because playerpos dont work)

id of effect is 136 i want to send this on player(x+1) 1200 times by 250(4 times per sec)
 
Last edited:
Lua:
local c = {
	max = 1200,
	effect = 136
}

local function addEffect(cid, count)
	if not(isPlayer(cid)) then return false end

	local tmpPos = getPlayerPosition(cid)
	doSendMagicEffect({x=tmpPos.x+1, y=tmpPos.y, z=tmpPos.z}, c.effect)

	if count <= c.max then
		addEvent(addEffect, 250, cid, count+1)
	end
end

function onSay(cid, words, param)
	addEvent(addEffect, 250, cid, 0)
	return true
end

Like this?
 
Last edited:
is talkactions?

[30/07/2012 20:10:58] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/xxx/xxx.lua:7: ')' expected near 'then'
[30/07/2012 20:10:58] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/xxx/xxx.lua)
[30/07/2012 20:10:58] data/talkactions/scripts/xxx/xxx.lua:7: ')' expected near 'then'
[30/07/2012 20:10:58] Reloaded talk actions.
 
You are the best reput:D

- - - Updated - - -

i want to change this like :

Code:
local c = {
	max = 120,
	effect = 136
}
 
local function addEffect(cid, count)
	if not(isPlayer(cid)) then return false end
 
	local tmpPos = getPlayerPosition(cid)
	doSendMagicEffect({x=tmpPos.x+1, y=tmpPos.y, z=tmpPos.z}, c.effect)
 
	if count <= c.max then
		addEvent(addEffect, 250, cid, count+1)
	end
end
 
function onSay(cid, words, param)
	if getPlayerVocation(cid) == 2 then
	if getPlayerLevel(cid) >= 100 then
	if getPlayerMana(cid) >= 2000 then
	if getPlayerHealth(cid) >= 2000 then
		doPlayerAddMana(cid, getPlayerHealth(cid)/100*90) else
	end
		doPlayerAddHealth(cid, getPlayerHealth(cid)/100*90) else
	end
	addEvent(addEffect, 250, cid, 0)
		doPlayerSendCancel(cid, "Susanoo Activated!")
	end
	return true
end


but data/talkactions/xx/xx.lua:30: 'end' expected (to close 'function' at line 17) near '<eof>'
 
Lua:
local c = {
	max = 120,
	effect = 136
}
 
local function addEffect(cid, count)
	if not(isPlayer(cid)) then return false end
 
	local tmpPos = getPlayerPosition(cid)
	doSendMagicEffect({x=tmpPos.x+1, y=tmpPos.y, z=tmpPos.z}, c.effect)
 
	if count <= c.max then
		addEvent(addEffect, 250, cid, count+1)
	end
end
 
function onSay(cid, words, param)
	if getPlayerVocation(cid) == 2 then
	if getPlayerLevel(cid) >= 100 then
	if getPlayerMana(cid) >= 2000 then
	if getPlayerHealth(cid) >= 2000 then
		doPlayerAddMana(cid, getPlayerHealth(cid)/100*90) else
	end
		doPlayerAddHealth(cid, getPlayerHealth(cid)/100*90) else
	end
	addEvent(addEffect, 250, cid, 0)
		doPlayerSendCancel(cid, "Susanoo Activated!")
	end
	return true
end
 end
 
[31/07/2012 13:26:40] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/susanoo.lua:1: '=' expected near 'c'
[31/07/2012 13:26:40] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/susanoo.lua)
[31/07/2012 13:26:40] data/talkactions/scripts/susanoo.lua:1: '=' expected near 'c'

i remove space like this "c= {"
and now is ok but when i use is :


[31/07/2012 13:30:46] data/talkactions/scripts/susanoo.lua:21: attempt to call global 'getPlayerHealth' (a nil value)
[31/07/2012 13:30:46] stack traceback:
[31/07/2012 13:30:46] data/talkactions/scripts/susanoo.lua:21: in function <data/talkactions/scripts/susanoo.lua:17>

- - - Updated - - -

Ok i make this is about theres no command getPlayerHealth is getCreatureHealth

is working:

local c= {
max = 5,
effect = 136
}

local function addEffect(cid, count)
if not(isPlayer(cid)) then return false end

local tmpPos = getPlayerPosition(cid)
doSendMagicEffect({x=tmpPos.x+1, y=tmpPos.y, z=tmpPos.z}, c.effect)

if count <= c.max then
addEvent(addEffect, 250, cid, count+1)
end
end

function onSay(cid, words, param)
if getPlayerVocation(cid) == 2 then
if getPlayerLevel(cid) >= 100 then
if getPlayerMana(cid) >= 2000 then
if getCreatureHealth(cid) >= 2000 then
doPlayerAddMana(cid, getPlayerMana(cid)/100*-90) else
end
doCreatureAddHealth(cid, getCreatureHealth(cid)/100*-90) else
end
addEvent(addEffect, 250, cid, 0)
doPlayerSendCancel(cid, "Susanoo Activated!")
end
return true
end
end
 

Similar threads

Back
Top