• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action [ACTIONS] an item you use and you get full mana & HP !

ghettobird

LUA newbie
Joined
Aug 17, 2013
Messages
679
Reaction score
132
Location
OTland
[ACTIONS] an item you use and you get full mana & HP !

Hey people, this is the first script i actually put in otland, not sure if it's helpfull but try it out anyway

add this to your actions/scripts folder.
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    doCreatureSay(cid,  "FULL MANA&HP!" ,19)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
doCreatureAddMana(cid, getPlayerMaxMana(cid))
	  return true
  end

now go to your actions.xml
Code:
<action itemid="theitemidyouwant" event="script" value="urscriptname.lua"/>


Tested & works on tfs 0.4

PS: you can put this for an item id and put that in temple then players use it, if you want it for low lvls only post here



Post bugs too, have fun :)

- - - Updated - - -

25 views and no comments? :(
 
Last edited:
why would people comment here anyway? it's a simple script anyone can make it and i'm sure it's not gonna have any bugs... (no offence)
 
Gelendizer, anyone can't make it, i can't make it and i find it very useful, so i will add it to my ot server, but i was wondering, how can i make it disapear after you use it plz
 
Lua:
doRemoveItem(item.uid, 1)
If you are looking for Lua functions, look in the folder doc, then in file LUA_FUNCTIONS.
The names often already explain what they do, or you can also look in other scripts for examples.
 
Last edited:
I recommend also do this:

Lua:
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
doCreatureAddMana(cid, getPlayerMaxMana(cid))
 
Done, check your theard.
 
Use:
Lua:
doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
doCreatureAddMana(cid, getPlayerMaxMana(cid) - getCreatureMana(cid))
instead to not give more hp than player can have.

It's great to see that you try your strenght in scripting but flooding forums with useless six liners that have been posted thousands of times is pointless. You're just letting really usefull scripts go to page 2 and die there. :p
 
well i can't script anything like you i'm just a beginner :p, also if i don't release what i do I'll never learn from my mistakes or know what people think about my scripts :p, but thank you :peace:
 
well i can't script anything like you i'm just a beginner :p, also if i don't release what i do I'll never learn from my mistakes or know what people think about my scripts :p, but thank you :peace:

You can always make a "ghettobird's short scripts" thread, and put it all together there. Imo that's a really good advice.
 
Back
Top