• 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 Mechanic Fish

Lava Titan

Developer
Joined
Jul 25, 2009
Messages
1,552
Solutions
1
Reaction score
88
Location
Portugal
I made this script but i cant find whats the problem with it cuz it isnt working...

It should be like:

Required storageid to use the fish: 10223
After using the fish the player would get itemid: 2196
After someone use the fish he wouldnt be able to use other.

LUA:
local storage = 10223

function onUse(cid, item, fromPosition, itemEx, toPosition)
         if getPlayerStorageValue(cid, storage) ~= 1 then
		     doPlayerAddItem(cid, 2196, 1)
	             doCreatureSay(cid, "You try to eat the fish.-WTF?!-It was turned into a pair of boots!" ,19)
			         setPlayerStorageValue(cid, 10224) then	 
	             else
		     doCreatureSay(cid, "You already used this fish!" ,19)
	     end
     return doRemoveItem(item.uid)
end

Can anyone fix the problem?
You will be rewarded with rep ofc =D
Thanks if you helped!
 
LUA:
local itemid = 2196
local storage = 10223

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerStorageValue(cid, storage) == -1 then
		return doPlayerSendTextMessage(cid, 18, "You havent done this quest yet.")
	end

	if getPlayerStorageValue(cid, storage) == 2 then
		return doPlayerSendTextMessage(cid, 18, "You already used this fish!")
	end
	doRemoveItem(item.uid)
	doPlayerAddItem(cid, itemid, 1)
	doPlayerSendTextMessage(cid, 18, "You try to eat the fish.-WTF?!-It was turned into a pair of boots!")
	setPlayerStorageValue(cid, storage, 2)
	return true
end
 
Last edited:
Back
Top