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

When the player dies he loses a percentage of total life/mana

Serene

Premium User
Premium User
Joined
Mar 3, 2016
Messages
40
Solutions
2
Reaction score
20
Hello, friends of otland. I've been searching in forum but didnt found any content related.

Would it be possible a script that when the player dies, he loses a percentage of total life and mana?

For example = death penalty: loses 2% of all life and mana (independent of the skull, but it would be nice if I could configure the penalty of each skull too, for example = red skull loses 10%)
 
Code:
function onpreparedeath()
if skull == red
player:setmaxmana(player:getmaxmana*0.90)
health^
end
end
like this
 
Code:
function onpreparedeath()
if skull == red
player:setmaxmana(player:getmaxmana*0.90)
health^
end
end
like this

Perfect, Xeraphus!

Is there any way after death the player received a message like: "You lost 2 percent of your total life and mana due your death."?
 
test this I'm not even a lua coder
Code:
function onpreparedeath()
if skull == red
player:setmaxmana(player:getmaxmana*0.90)
player:sendTextMessage(MESSAGE_INFO_DESCR, "You lost 2 percent of your total life and mana due your death.")
health^
end
end
@Davidvietro
 
Last edited:
Back
Top