Information:
Hi, i'm noob in scripting area, this is my first script, please give suggestions for me, about my script:
When you use one item (2346) add +250 points in you health, and 500 points in you mana, this points you can edit. lets begin:
Script:
Create one file in Actions/Scripts, with name restore.lua
Copy & Paste this:
PHP:
--- CREATED BY BRYAN GROBMANN (XTREMOXX) ---
function onUse(cid, item, frompos, item2, topos)
local MANA = 500
local LIFE = 250
doCreatureAddMana(cid, MANA)
doCreatureAddHealth(cid, LIFE)
doSendMagicEffect(getThingPos(item.uid), CONST_ME_MAGIC_BLUE)
doCreatureSay(cid, "Guuulp", TALKTYPE_ORANGE_1)
doRemoveItem(item.uid)
end
In actions.xml:
PHP:
<action itemid="2346" script="restore.lua"/>
Editing & SS:
I'm using itemid 2346, (
After you use:
Guuuulp.. : Message When player use Item
LIFE: Who much Health restore
MANA: Who much Mana restore
EDITED POST:
SCRIPT WITH RANDOM VALUES!!! SPECIAL THANKS TO Keraxel
I don't add exhausted in this script, because for you add exhausted, you need go to, config.lua in you folder server, and edit the lines:
i'm using 1700, is good exhausted for actions, try it.
Suggestions Please!!! Remember, This is my first Script! :thumbup::thumbup:
SCRIPT WITH RANDOM VALUES!!! SPECIAL THANKS TO Keraxel
PHP:
--- CREATED BY BRYAN GROBMANN (XTREMOXX) ---
function onUse(cid, item, frompos, item2, topos)
local MANA = math.random(102, 341)
local LIFE = math.random (102, 341)
doCreatureAddMana(cid, MANA)
doCreatureAddHealth(cid, LIFE)
doSendMagicEffect(getThingPos(item.uid), CONST_ME_MAGIC_BLUE)
doCreatureSay(cid, "Guuulp..", TALKTYPE_ORANGE_1)
doRemoveItem(item.uid)
end
I don't add exhausted in this script, because for you add exhausted, you need go to, config.lua in you folder server, and edit the lines:
PHP:
-- Item usage
timeBetweenActions = 1700
timeBetweenExActions = 1700
i'm using 1700, is good exhausted for actions, try it.
Suggestions Please!!! Remember, This is my first Script! :thumbup::thumbup:
Last edited: