Hey guys!
I've got:
And on death there I'm getting this error and standing without HP:
Where is the problem? I think, that this is script for 1.x but i need it for 0.4
I've got:
Lua:
function onLogin(cid)
return true
end
local arena = {
from = {x = 459, y = 15, z = 7}, -- left top corner of arena
to = {x = 470, y = 18, z = 7}, -- right bottom corner of arena
temple = { x = 472, y = 11, z = 7 } -- change it to temple pos
}
function onPrepareDeath(cid, killer)
if isInRange(getPlayerPosition(cid), arena.from,arena.to) then
if isPlayer(cid) then
Player(cid):addHealth(Player(cid):getMaxHealth())
Player(cid):addMana(Player(cid):getMaxMana())
Player(cid):teleportTo(arena.temple, true)
return false
end
end
return true
end
function isInRange(pos, fromPos, toPos)
return pos.x >= fromPos.x and pos.y >= fromPos.y and pos.z >= fromPos.z and pos.x <= toPos.x and pos.y <= toPos.y and pos.z <= toPos.z
end
And on death there I'm getting this error and standing without HP:
Code:
1:28:38.785] [Error - CreatureScript Interface]
[1:28:38.785] data/creaturescripts/scripts/Arena_Ups.lua:onPrepareDeath
[1:28:38.785] Description:
[1:28:38.785] data/creaturescripts/scripts/Arena_Ups.lua:15: attempt to call global 'Player' (a nil value)
[1:28:38.786] stack traceback:
[1:28:38.786] data/creaturescripts/scripts/Arena_Ups.lua:15: in function <data/creaturescripts/scripts/Arena_Ups.lua:12>
[1:28:39.293] [Error - CreatureScript Interface]
[1:28:39.293] data/creaturescripts/scripts/Arena_Ups.lua:onPrepareDeath
Where is the problem? I think, that this is script for 1.x but i need it for 0.4