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

Jewelcrafting script by Legolas23

legolas23

New Member
Joined
Jan 8, 2009
Messages
537
Reaction score
3
So here's my second realse on Otland forums. This script is very simple but I think it is a good idea for fun or rpg servers.

Now I will explain how does it work.
When you click on item that you want to craft jewel from it will disappear and change into one of jewels that you have in script.

Actions/scripts/jew.lua
Code:
----Jewelcrafting script by Legolas23----
function onUse(cid, item, frompos, item2, topos)
 local drop = {2153, 2154 ,2155, 2156}     		---- Jewels
 local scchance = 50							---- Chance to craft
 local material = 2225					        ---- material for jewelcraft
	
if item.itemid == material then
	if scchance >= math.random(1,100) then
			doTransformItem(item.uid, drop[math.random(1, #drop)])
			doPlayerSendTextMessage(cid,22,"You have sucessfuly crafted a Jewel!")
			doSendMagicEffect(getPlayerPosition(cid),12)
		else
			doPlayerSendTextMessage(cid,22,"Jewelcrafting failed")
			doRemoveItem(item.uid, 1)
		end
	end			
return TRUE
end

Actions/actions.xml
Code:
<action itemid="2225" event="script" value="jew.lua"/>

Enjoy!!!
If you like this script don't forget to Rep++ me :)
 
Last edited:
Code:
doTransformItem(item.uid, drop[math.random(1,4)])

Change to:
Code:
doTransformItem(item.uid, drop[math.random(1, #drop)])

# <-- Will get count of elements in table.
 
Back
Top