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

Use willow to get special flask

poopsiedoodle

Gibe moni plos
Joined
Nov 23, 2011
Messages
2,452
Reaction score
580
Location
Georgia
Can someone make me a script to use a willow (ID: 2702) to get a Special Flask (ID: 8205) that can be done only once per player?
 
Last edited:
When I use the tree with sirion's

sirion_zpsa01d4947.png


Time to try Cyko's again, now that Limos has identified the problem.

EDIT: Cyko's crashes the client. No console errors though.
 
Last edited:
Try this :S
HERE WE ARE
In your actions/actions.xml paste the following code:
XML:
	<action uniqueid="9898" event="script" value="willow.lua" />

Now In your actions/scripts create file name willow.lua and paste the following:
Lua:
local storage = 9898
local itemids = 8205
local sirion = getPlayerStorageValue(cid,storage)
function onUse(cid, item, fromPosition, itemEx, toPosition)
   		if sirion == -1 then
   			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found a special flask.")
   			doPlayerAddItem(cid,itemids,1)
   			setPlayerStorageValue(cid,storage,1)
   		else
   			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")
	end
   	return true
end

now go to your willow and make on it uniqueid = 9898

IT SHOULD WORK.
 
Lua:
local cyko = {
	storage = 9999, --add unsuded storage
	reward = 8205--itemid as reward
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerStorageValue(cid,cyko.storage) == -1 then
		doPlayerAddItem(cid,cyko.reward,1)
		doPlayerSendTextMessage(cid,25,"You have found a special flask.")
		setPlayerStorageValue(cid,cyko.storage, 1)
	else
		doPlayerSendTextMessage(cid,25,"The willow is empty.")
		end
	return true
end

@ poopsiedoodle
Use MESSAGE_INFO_DESCR instead of 25
Lua:
local cyko = {
	storage = 9999, --add unsuded storage
	reward = 8205--itemid as reward
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerStorageValue(cid,cyko.storage) == -1 then
		doPlayerAddItem(cid,cyko.reward,1)
		doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found a special flask.")
		setPlayerStorageValue(cid,cyko.storage, 1)
	else
		doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "The willow is empty.")
	end
	return true
end
 
Really i dont know what is the problem in this script , cyko's script works
my script works
so problem not in our scripts ;s problem in you or your server..
 
TFS.jpg

Should there be another "end" after return true?

EDIT: I put an end after Return True and it works fine except for one thing: I used the willow and it said the willow is empty, but it still gave me the Special Flask.
 
Show the script, there shouldn't be an extra end because the last end is for the function onUse, so you probable accidentally removed something.
 
local cyko = {
storage = 9999, --add unsuded storage
reward = 8205--itemid as reward
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid,cyko.storage) == -1 then
doPlayerAddItem(cid,cyko.reward,1)
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found a special flask.")
setPlayerStorageValue(cid,cyko.storage, 1)
else
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "The willow is empty.")
end
return true
end

It works, but it just says the willow is empty even though it gives me the flask.
 
Back
Top