Nirer
New Member
This script basically does the following:
You put a blueberry on proper ground (you decide which ground is proper) use a hoe (not a slut -.- ) on the blueberry and POOF a blueberry bush appears... The blueberry bush will disappear in xxx seconds which you provide...
like this:
YouTube - Nirer's Farming Script!
1)Go into you \data\actions\scripts\tools directory, then create a new file named "hoe" (.lua of course) and paste this inside:
adjust lines 4 and 5 to your server...
2) go into your \data\actions directory, open actions.xml and paste this:
YOU'RE DONE!
ONLY BEEN TESTED ON TFS!
CREATED BY ME, DO NOT STEAL OR W/E...
You put a blueberry on proper ground (you decide which ground is proper) use a hoe (not a slut -.- ) on the blueberry and POOF a blueberry bush appears... The blueberry bush will disappear in xxx seconds which you provide...
like this:
YouTube - Nirer's Farming Script!
1)Go into you \data\actions\scripts\tools directory, then create a new file named "hoe" (.lua of course) and paste this inside:
PHP:
----------------Script By Nirer/Kakashi~Sensei----------------
-----------------------DO NOT COPY!-----------------------
function onUse(cid, item, fromPosition, itemEx, toPosition)
local grounds={106, 4529, 103, 3263} --Add more ground ID's of PROPER GROUNDS--
local time_of_tree_death_in_seconds=10 --Change it to whatever you want (set to 10 seconds and tree disappears)--
if(itemEx.itemid==2677 and itemEx.type==1) then
local ground_position={x=toPosition.x, y=toPosition.y, z=toPosition.z, stackpos=0}
local ground_information=getThingfromPos(ground_position)
if(isInArray(grounds, ground_information.itemid)==TRUE) then
doTransformItem(itemEx.uid, 2785)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congradulations! You got a nice BUSH!")
addEvent(treeDie, time_of_tree_death_in_seconds*1000, {position=toPosition})
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "This is not the proper ground...")
end
elseif(itemEx.type~=1) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You may only grow one bush at a time.")
end
return TRUE
end
function treeDie(parameter)
local tree=getThingfromPos{x=parameter.position.x, y=parameter.position.y, z=parameter.position.z, stackpos=1}
doRemoveItem(tree.uid)
end
adjust lines 4 and 5 to your server...
2) go into your \data\actions directory, open actions.xml and paste this:
PHP:
<action itemid="2552" script="tools/hoe.lua"/>
YOU'RE DONE!
ONLY BEEN TESTED ON TFS!
CREATED BY ME, DO NOT STEAL OR W/E...