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

~Add more Healt to player~

killing

Member
Joined
Feb 23, 2012
Messages
815
Reaction score
11
Location
BIH
Hello
I need Script that well giv Player 1000 more Healt.
example:
TfFrBKs.png

If player have max healt 500 and now if he use This Healt Rune he well have 1000 more Healt in MaxHealt.
I hope you understand what I need.
Rep++
 
I mean Forever.
Do u see on Pic Healtmax = (2560) i want to there be added more + 1000 Healt.

- - - Updated - - -

bump
 
Lua:
db.executeQuery("UPDATE `players` SET `healthmax` = healthmax + 1000 WHERE `id` = " .. getPlayerGUID(cid))

If you want to learn mysql queries: Common MySQL Queries

teckman thanks, but You have just confused me.Where to put that what is that..
I was Thinking to i well get Script to put in Actions..
i totally don't understand this.



Im not pro like you..
 
/actions/scripts/healthRune.lua

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	db.executeQuery("UPDATE `players` SET `healthmax` = healthmax + 1000 WHERE `id` = " .. getPlayerGUID(cid))
	doRemoveItem(item.uid)
	return true
end

...
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
creature = getTopCreature(toPosition)
setCreatureMaxHealth(creature.uid, getCreatureMaxHealth(creature.uid)+500)
return true
end
I dident tested it but should work.
Add this script to an rune in actions
 
i know i made it 1 min ago onfly...
he wanted an rune, and runes do things on target. ;)
Sure if he wants to use it onhimself allways:


function onUse(cid, item, fromPosition, itemEx, toPosition)
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+500)
return true
end
 
ok Thanks..

- - - Updated - - -

ehhe
Well
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	db.executeQuery("UPDATE `players` SET `healthmax` = healthmax + 1000 WHERE `id` = " .. getPlayerGUID(cid))
	doRemoveItem(item.uid)
	return true
end

teckman can u make some changes:Add Text
 
Take this

Lua:
<action itemid="itemid" event="script" value="namescript.lua"/>

Lua:
function onUse(cid, item, frompos, item2, topos)
    if (getPlayerStorageValue(cid, STORAGE) < 1) then
    setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+1000)
    doSendMagicEffect(getPlayerPosition(cid), 27)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Your health now is : " .. getCreatureMaxHealth(cid) .. ".")  
    doRemoveItem(item.uid, 1)
    else
      doPlayerSendTextMessage(cid, 22, "You can't use this.")
  end
end
 
Last edited:
Take this

Lua:
<action itemid="itemid" event="script" value="namescript.lua"/>

Lua:
function onUse(cid, item, frompos, item2, topos)
    if (getPlayerStorageValue(cid, STORAGE) < 1) then
    setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+1000)
    doSendMagicEffect(getPlayerPosition(cid), 27)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Your health now is : " .. getCreatureMaxHealth(cid) .. ".")  
    doRemoveItem(item.uid, 1)
    else
      doPlayerSendTextMessage(cid, 22, "You can't use this.")
  end
end


Thanks so Much!!
it works Percefy rep++..

But if i can ask can u add to text be Like this
WuJLMJT.png

Just to it Says healt not mana xD
and to player can use it only once..
 
Thanks so Much!!
it works Percefy rep++..

But if i can ask can u add to text be Like this
WuJLMJT.png

Just to it Says healt not mana xD
and to player can use it only once..


function onUse(cid, item, frompos, item2, topos)
if (getPlayerStorageValue(cid, 7777) ==-1) then
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+1000)
doSendMagicEffect(getPlayerPosition(cid), 27)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Your have recieved 1000 health points, now your health is " .. getCreatureMaxHealth(cid) .. "!")
doRemoveItem(item.uid, 1)
setPlayerStorageValue(cid, 7777, 1)
else
doPlayerSendTextMessage(cid, 22, "You can't use this.")
end
end




im otta here!
 
Back
Top