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

Solved Pits of Inferno script error

richux

Tibera.org
Joined
Aug 18, 2008
Messages
3,666
Reaction score
26
Location
---------
Hello!

As you all know, to do poi you need 4 vocations. Because only sorcerers can go trought sorc fire and pallys trough pally fire and so on... Cuz of some reason none of poi fires are working for me. If I go with knight on pally fire I dont die, it even does not take 300hp from me(it actualy had to kill me). Im getting following errors in my console:


Code:
[26/04/2009 03:14:12] Lua Script Error: [MoveEvents Interface] 
[26/04/2009 03:14:12] data/movements/scripts/poi/firesorc.lua:onStepIn

[26/04/2009 03:14:12] data/movements/scripts/poi/firesorc.lua:5: attempt to call global 'getPlayerHealth' (a nil value)
[26/04/2009 03:14:12] stack traceback:
[26/04/2009 03:14:12] 	data/movements/scripts/poi/firesorc.lua:5: in function <data/movements/scripts/poi/firesorc.lua:1>

Here is the script:

Code:
function onStepIn(cid, item, pos)

zabierz = 300
kolor = 180
zycie = getPlayerHealth(cid)
topos = getPlayerPosition(cid)

if item.actionid == 9876 and getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 4 or getPlayerVocation(cid) == 6 or getPlayerVocation(cid) == 7 or getPlayerVocation(cid) == 8 then
doPlayerAddHealth(cid, -zycie)
doSendAnimatedText(topos, zycie, kolor)
doSendMagicEffect(getPlayerPosition(cid), 15)
end

if item.actionid == 9876 and getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 5 then
doPlayerAddHealth(cid, -zabierz)
doSendAnimatedText(topos, zabierz, kolor)
doSendMagicEffect(getPlayerPosition(cid), 15)
end


if item.actionid == 9876 and getPlayerVocation(cid) == 10 then
doSendMagicEffect(getPlayerPosition(cid), 0)

end
return 1
end

Also I would be thankfull if you posted your own poi script that works if this can't be fixed.

Thank you!
 
Last edited:
PHP:
local zabierz = 300
local kolor = 180

function onStepIn(cid, item, pos)

local zycie = getCreatureHealth(cid)
local topos = getCreaturePosition(cid)

if item.actionid == 9876 and isSorcerer(cid) == FALSE then
doCreatureAddHealth(cid, -zycie)
doSendAnimatedText(topos, zycie, kolor)
doSendMagicEffect(topos, 15)
end

if item.actionid == 9876 and isSorcerer(cid) == TRUE then
doCreatureAddHealth(cid, -zabierz)
doSendAnimatedText(topos, zabierz, kolor)
doSendMagicEffect(topos, 15)
end

if item.actionid == 9876 and getPlayerGroupId(cid) > 1 then
doSendMagicEffect(topos, 0)

end
return 1
end

Now, I suppose I'll have to do this with all your scripts?
Post them all in an attachment ;)
 
@up

My ot loads your script without any errors, but when I walk on the fire it doesn not work at all. I can easy run on them with any vocations. No damage, no errors in console. :D
 
Bumppzor! going to do some stuff, will be back after ~2hours, hope someone will post a working script from his own ot or fix mine :D

Ahh ye, and can someone tell me what the heck means -

local zabierz = 300
local kolor = 180

and

local zycie
local topos

?

:* Love ya all!
 
PHP:
local zabierz = 300
local kolor = 180

function onStepIn(cid, item, pos)

local zycie = getCreatureHealth(cid)
local topos = getCreaturePosition(cid)

if item.actionid == 9876 and isSorcerer(cid) == FALSE then
doCreatureAddHealth(cid, -zycie)
doSendAnimatedText(topos, zycie, kolor)
doSendMagicEffect(topos, 15)
end

if item.actionid == 9876 and isSorcerer(cid) == TRUE then
doCreatureAddHealth(cid, -zabierz)
doSendAnimatedText(topos, zabierz, kolor)
doSendMagicEffect(topos, 15)
end

if item.actionid == 9876 and getPlayerGroupId(cid) > 1 then
doSendMagicEffect(topos, 0)

end
return 1
end

Now, I suppose I'll have to do this with all your scripts?
Post them all in an attachment ;)

He could just add
Code:
getPlayerHealth = getCreatureHealth
into his compat.lua and all the scripts using it would work :)



Bumppzor! going to do some stuff, will be back after ~2hours, hope someone will post a working script from his own ot or fix mine :D

Ahh ye, and can someone tell me what the heck means -

local zabierz = 300
local kolor = 180

and

local zycie
local topos

?

:* Love ya all!
local zabierz = the 300 health that the player will lose
local kolor = the color of the animated text (TEXTCOLOR_RED = 180)
local zycie = the max health of the player
local topos = the position of the player

You can rename all those to something easier for you to understand if you want :)
Just make sure you change them in the script also.

PS: Did you notice that Cykotitan moved these two lines
PHP:
local zabierz = 300 
local kolor = 180
to above the onStepIn function?
This is because the server will only get these values at the start of the server while
PHP:
local zycie = getCreatureHealth(cid) 
local topos = getCreaturePosition(cid)
need to be getten at each time the script is executed because they are always changing. Remember this while making future scripts. :)
 
He could just add
Code:
getPlayerHealth = getCreatureHealth
into his compat.lua and all the scripts using it would work :)

Thank you! I added that thing in my compat.lua, after that added
Code:
]doPlayerAddHealth = doCreatureAddHealth
And now all fires started to work perfectly!

Much love bro! God bless u! =***

:D
 
Back
Top