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

onstatschange

Status
Not open for further replies.

SpiderOT

™ツʂριԃҽɾσƚ➽ ٩(•‿•)۶★彡
Joined
Sep 29, 2008
Messages
1,062
Solutions
10
Reaction score
291
Location
Egypt/cairo
hello
here is my script it work fine but sometime when player die it crash server
Lua:
function onStatsChange(cid, attacker, type, combat, value)
local posp = getCreaturePosition(cid)
local frompos = {x=1776, y=1635, z=7}
local topos = {x=1833, y=1699, z=7}
local temple = { x = 1084, y = 653, z = 7}
if isInArea(posp, frompos, topos) then
if (type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS) then
doTeleportThing(cid, temple)
setPlayerStorageValue(cid, 901, 0)
end
end
return true
end
any idea why??
 
hello
here is my script it work fine but sometime when player die it crash server
Lua:
function onStatsChange(cid, attacker, type, combat, value)
local posp = getCreaturePosition(cid)
local frompos = {x=1776, y=1635, z=7}
local topos = {x=1833, y=1699, z=7}
local temple = { x = 1084, y = 653, z = 7}
if isInArea(posp, frompos, topos) then
if (type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS) then
doTeleportThing(cid, temple)
setPlayerStorageValue(cid, 901, 0)
end
end
return true
end
any idea why??

try this:
Lua:
function onStatsChange(cid, attacker, type, combat, value)
local posp = getCreaturePosition(cid)
local frompos = {x=1776, y=1635, z=7}
local topos = {x=1833, y=1699, z=7}
local temple = { x = 1084, y = 653, z = 7}
if type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS and isInArea(posp, frompos, topos) == true then
doTeleportThing(cid, temple)
setPlayerStorageValue(cid, 901, 0)
return true
end
return true
end
 
Status
Not open for further replies.
Back
Top