• 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 Item On Use Switch

XRobin

Beginner Mapper/Spriter
Joined
Nov 13, 2008
Messages
99
Reaction score
0
Screenshot:
qxnibq.jpg

Script:
Lua:
local cost = 1000000
local newItem = {7388, 1}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if doPlayerRemoveMoney(cid, cost) == FALSE then
		doPlayerSendTextMessage(cid, 26, "You need "..cost.." gold coins for "..newItem[2].."x "..getItemNameById(newItem[1])..".")
		doSendMagicEffect(getCreaturePosition(cid), 2)
		return TRUE
	end
	
	if item.itemid == 1945 then
		doTransformItem(item.uid, 1946)
	else
		doTransformItem(item.uid, 1945)
	end

	doPlayerAddItem(cid, newItem[1], newItem[2])
	doPlayerSendTextMessage(cid, 22, "You bought "..newItem[2].."x "..getItemNameById(newItem[1]).." for "..cost..".")
	return TRUE 
end

Regards,
XRobin
------
Credits : Shawak
 
Last edited:
I've seen this script somewhere else do not remember, in the end scripter ta legal maybe I boat in my otserv:D
 
Back
Top