RazorBlade
Retired Snek
Hey guys, me again. Decided to share another of my scripts that I made for my own pleasure. It's really quite basic, but as per usual, I've added notes to help newbie scripters
So basically this script makes it possible to say !mush (It is case-sensative, so don't use any capital letters) and it "eats"* a fire mushroom from your backpack or arrows slot or hand or anywhere in your inventory then adds 2500 hitpoints and mana points to your character. Obviously it's easy to change the words to something else, you can change the item used, and you can change the health and mana gained. You could even add soul points with the
function.
So in talkactions.xml, put
This is where you can change the words from !mush to whatever you want.
Now in the scripts folder, make a file called "mush.lua" and paste this:
Any questions or concerns can be directed at meee.
*By "eats" I don't mean it actually eats the mushroom. It only seems like it. So don't use this to easily eat food Won't help you
So basically this script makes it possible to say !mush (It is case-sensative, so don't use any capital letters) and it "eats"* a fire mushroom from your backpack or arrows slot or hand or anywhere in your inventory then adds 2500 hitpoints and mana points to your character. Obviously it's easy to change the words to something else, you can change the item used, and you can change the health and mana gained. You could even add soul points with the
Code:
doPlayerAddSoul(cid, soul)
So in talkactions.xml, put
Code:
<talkaction words="!mush" script="mush.lua"/>
Now in the scripts folder, make a file called "mush.lua" and paste this:
Code:
--Script with NewbieNotes made by RazorBlade--
function onSay(cid, words, param) --The function being used
if getPlayerItemCount(cid,2795) >= 1 then --Checks for 1 or more fire mushrooms
doPlayerRemoveItem(cid,2795,1) --Removes 1 fire mushroom from the player's total amount
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Yummy!") --Sends the message "Yummy!" to the player in green text.
doCreatureAddHealth(cid, 2500) --Adds 2500 hitpoints to the player
doPlayerAddMana(cid, 2500) --Adds 2500 mana points to the player
else --If the system checks for something and doesn't get the set answer, it moves to the line following the word "else" and the function of the script may not occur.
doPlayerSendCancel(cid, "You don't have any fire mushrooms.") --Sends a cancel message to the player.
end --Ends the last function
end --Ends the second-last script
Any questions or concerns can be directed at meee.
*By "eats" I don't mean it actually eats the mushroom. It only seems like it. So don't use this to easily eat food Won't help you