Thorn
Spriting since 2013
Hello guys, i found a script here to allow people below X lvl to have free bless, however its generating an error for new players, first time logging in players
the error is this
And the code is this
Can anyone help me fix this issue plz?? D:
Thanks in advance!!
the error is this
Code:
Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/others/freebless.lua:onLogin
data/creaturescripts/scripts/others/freebless.lua:8: attempt to call global 'getThingPosition' (a nil value)
stack traceback:
[C]: in function 'getThingPosition'
data/creaturescripts/scripts/others/freebless.lua:8: in function <data/creaturescripts/scripts/others/freebless.lua:2>
And the code is this
Lua:
local freeBlessMaxLevel = 50 --- your max lvl to get free bless
function onLogin(cid)
if(getPlayerLevel(cid) <= freeBlessMaxLevel and not getPlayerBlessing(cid,1)) then
for b=1, 5 do
doPlayerAddBlessing(cid, b) --- here it add the bless
end
doCreatureSay(cid, 'You got free bless, because your level lower than 50', TALKTYPE_ORANGE_1) --- info why he get bless
doSendMagicEffect(getThingPosition(cid), CONST_ME_HOLYDAMAGE)
elseif(getPlayerBlessing(cid,1)) then
doCreatureSay(cid, 'You are blessed!', TALKTYPE_ORANGE_1)
else
doCreatureSay(cid, 'You are not blessed.', TALKTYPE_ORANGE_1)
end
return true
end
Can anyone help me fix this issue plz?? D:
Thanks in advance!!