Cosmotonio
New Member
- Joined
- Nov 26, 2007
- Messages
- 142
- Reaction score
- 0
someone help with my code?
Code:
function doShower(cid, type, y, x, effect, dano)
area = {fromx=(getPlayerPosition(cid)-x), fromy=(getPlayerPosition(cid)-y),
tox=(getPlayerPosition(cid)+x), toy=(getPlayerPosition(cid)+y), z=(getPlayerPosition(cid))}
if dano == 1 then
damage = -1
else
damage = 1
end
danomin = (getPlayerLevel(cid)*0.75 + 30)*(damage)
danomax = (getPlayerLevel(cid)*1.10 + 30)*(damage)
if getTilePzInfo(getCreaturePosition(cid)) == 0 then
for i = area.fromx, area.tox do
for j = area.fromy, area.toy do
local pos = {x=i, y=j, z=area.z, stackpos=253}
local getThing = getThingfromPos(pos).uid
if isCreature(getThing) == 1 then
doTargetCombatHealth(cid, getThing, type, danomin,
danomax, effect)
end
end
end
else
doPlayerSendCancel(cid, 'You cannot use shower in PZ.')
end
end
function onSay(cid, words, param)
cid = cid
if isSorcerer(cid) then
type = COMBAT_PHYSICALDAMAGE
x = 7
y = 6
dano = 1
effect = CONST_ANI_BURSTARROW
elseif isDruid(cid) then
type = COMBAT_PHYSICALDAMAGE
x = 7
y = 6
dano = 1
effect = CONST_ANI_BURSTARROW
elseif isPaladin(cid) then
type = COMBAT_PHYSICALDAMAGE
x = 7
y = 6
dano = 1
effect = CONST_ANI_BURSTARROW
elseif isKnight(cid) then
type = COMBAT_PHYSICALDAMAGE
x = 7
y = 6
dano = 1
effect = CONST_ANI_BURSTARROW
else
type = COMBAT_PHYSICALDAMAGE
x = 7
y = 6
dano = 1
effect = CONST_ANI_BURSTARROW
end
doShower(cid, type, y, x, effect, dano)
end
Code:
[26/03/2008 21:14:03] Lua Script Error: [TalkAction Interface]
[26/03/2008 21:14:03] data/talkactions/scripts/shower.lua:onSay
[26/03/2008 21:14:03] data/talkactions/scripts/shower.lua:3: attempt to perform arithmetic on a table value
Last edited: