• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Healing temple

Roni92

New Member
Joined
Apr 25, 2010
Messages
50
Reaction score
1
I want to heal players every 1 second when they are in pos 160,51,7.
Here is my script:

if getCreaturePosition(cid) == {x = 160, y = 51, z = 7, stackpos = 1}
then
doCreatureAddHealth(cid, 10)
end
end

But i have error in server engine:
[13/06/2010 21:32:48] [Warning - Event::loadScript] Event onThink not found (data/globalevents/scripts/ladowanietemple.lua)

Need help :)
 
try this

Code:
function onThink(cid, interval)
local v = {x = 160, y = 51, z = 7}
	if getThingFromPos(v) == isPlayer(cid) then
		doCreatureAddHealth(cid,10)
	end
	return true
end
 
Code:
function onThink(cid, interval)
local v = {x = 160, y = 51, z = 7}
	if getThingFromPos(v) == isPlayer(cid) then
		doCreatureAddHealth(getThingFromPos(v),10)
	end
	return true
end
 
LUA:
local pos={
{x=465, y=278, z=7},
{x=466, y=278, z=7},
{x=467, y=278, z=7},
{x=465, y=279, z=7},
{x=466, y=279, z=7},
{x=467, y=279, z=7}}


function onThink(interval)

for _, v in pairs(pos) do
 doSendMagicEffect(v, 12)
   doSendAnimatedText(v, '+200', 30)
     doAreaCombatHealth(cid, 1, v, {1}, 200, 200, 12)
    end
  return true
end
 
Beon's script doesn't work, too, but effects and numbers are shown. Meybe this is caused i using this script in globalevents?
Edit: I found the reason! This doesn't work becaus it is in PZ. Is it possible to make this work in pz, too ?
 
Code:
function onThink(interval)
	if getThingFromPos({x=160, y=51, z=7, stackpos=253}).itemid > 0 then
		doCreatureAddHealth(getThingFromPos({x=160, y=51, z=7, stackpos=253}).uid, 10)
	end
return true
end
 
Code:
function onThink(cid, interval)
local v = {x = 160, y = 51, z = 7}
	if getThingFromPos(v) == isPlayer(cid) then
		doCreatureAddHealth(getThingFromPos(v),10)
	end
	return true
end

lol'd
attempt to compare number with boolean value-.-
getThingFromPos(v).uid == cid ..
 
Back
Top