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

Lua 8.10 Aries (Reborn type of thing).

V

varhlak

Guest
Hey, i am trying to make an statue/item/ whatever, so when you use it, it 'resets' your level to 50, changes your exp to listed below and gives you x Hp/mana and current vocation. Although it's somehow not working. Can somebody help me with the script?

Lua:
function onUse(cid, item, frompos, item2, topos)    
        if getPlayerLevel(cid) < 500000 then
        doPlayerAddExp(cid,-9000000000000000000000)
        doPlayerAddExp(cid,1846450)
        doPlayerSetVocation(cid,50)
        doPlayerAddHealth(cid,269)
        doPlayerAddMana(cid,119)
        doPlayerSendTextMessage(cid,1,"Your soul has been sacrificed. You are now a Demonhunter.")
    else
    doPlayerSendTextMessage(cid,1,"Sorry, you have to be at least level 500,000 to sacrifice your soul.")
    end
end
I have no idea why it doesnt do what it is indicated to - mainly, the problem is - however i use it, it just shows me i have to be level 500,000 - though im 504k ;). Also - so people don't troll me, theres my actions.xml file :
Lua:
<actions>


<!-- Demonhunter / powers -->
<action actionid="8955" script="demonhunter.lua" />

Thanks and hoping for somebody to assist me.
 
Use the database editing method.
Take a look here: http://otland.net/f81/reborn-system-w-stages-look-144641/
In reset.lua, you can see how he did it.

EDIT:

LOL!

"I have no idea why it doesnt do what it is indicated to - mainly, the problem is - however i use it, it just shows me i have to be level 500,000 - though im 504k . Also - so people don't troll me, theres my actions.xml file : "

HERE is your problem:

Lua:
if getPlayerLevel(cid) < 500000 then
 
What do you mean by 'there's your problem' ? I don't really see anything wrong with this line.

Previous script for promotion looked like this
Lua:
function onUse(cid, item, frompos, item2, topos)
if getPlayerVocation(cid) > 20 then
doPlayerSendTextMessage(cid,1,"Sorry, you are already promoted..")
elseif getPlayerVocation(cid) < 17 then
doPlayerSendTextMessage(cid,1,"Sorry, you need to have the fourth promotion first..")
elseif getPlayerLevel(cid) < 300000 then
doPlayerSendTextMessage(cid,1,"Sorry, you need level 300k to recieve this promotion.")
else
doPlayerSetVocation(cid, getPlayerVocation(cid)+4)
doPlayerSendTextMessage(cid,1,"You have been promoted!")
doRemoveItem(item.uid,1)
	end
	return 1

end

And it worked 100% fine, i don't get how this doesnt work, should i just do it as the one before?

REMEMBER : IT's 8.10 XML - NOT SQL.
 
Oh Aries. I liked that distro so much :D It sucks really much tho. Try to use SQL. XML is like, a cobweb inside a cobweb inside a dead spider buried 100 km below ground.
 
You said you were level 504,000, right?

Look here:
Lua:
if getPlayerLevel(cid) < 500000 then

Can you see the problem now?
 
Hey, one more thing. I am not pretty sure how this thing works, what i want it to do is :

If the player is level higher than 500k, they can reborn themself into a new vocation.
It will take their whole exp and they will be left with 1846450,
It will also make their new HP 269, and 119 mana on level 50 - am i right?

If not, can you please tell me -what im doing wrong?
 
Just remember something, you should make the script check what vocation you are.
Otherwise, you'd have the reborn vocation being able to use this script again, resetting everything and still being the same vocation.
 
I did test it just now, what it does is ->

Changes my vocation to demonhunter (voc 50) and that's it lol

It gives me a notation 15:53 Your soul has been sacrificed. You are now a Demonhunter.

Nothing apart from that.

otland.jpg < that's how it looks.
Should i do
Lua:
 		doPlayerAddHealth(cid,-90000000000000000)
		doPlayerAddMana(cid,-900000000000000000)
and then
Lua:
doPlayerAddHealth(cid,269)
		doPlayerAddMana(cid,119)
 
Okay, i listened to your tips and changed my script to :
Lua:
 function onUse(cid, item, frompos, item2, topos)
	if getPlayerVocation(cid) > 24 then
		doPlayerSendTextMessage(cid,1,"Sorry, your soul has already been sacrificed.")
	elseif getPlayerLevel(cid) < 500000 then
		doPlayerSendTextMessage(cid,1,"Sorry, you need at least level 500,000 to sacrifice your soul.")
	else
		doPlayerAddExp(cid,-1000000000000000000000000)
		doPlayerAddExp(cid,1846450)
		doPlayerSetVocation(cid,50)
			doCreatureAddHealth(cid,-909090900000269)
			doCreatureAddMana(cid,-909090909090119)
			doCreatureAddHealth(cid,269)
			doCreatureAddMana(cid,119)
		doPlayerSendTextMessage(cid,1,"Your soul has been successfully sacrificed, you are now a Demonhunter!.")
	end
	return 1
	
end

I will test and let you know if its working like it's supposed to :)
 
Okay, so i tested it and it WORKS in someway at least.

1. I am a demonhunter -
16:37 You see yourself. You are a Demonhunter.
16:38 Sorry, your soul has already been sacrificed.
Works

2. I am under level 500,000 -
16:38 Sorry, you need at least level 500,000 to sacrifice your soul.
Works

3. I have the rights to sacrifice - level 659,120 (exp - 4772418019759017005) and below voc 50 -
You lose (whole hp).
You are dead.
16:54 You see yourself. You are a Demonhunter.
Although my level and exp is still the same.
 
Back
Top