• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Click to change

Werewolf

Forbidden Ascension
Joined
Jul 15, 2012
Messages
886
Reaction score
123
does anyone know how to make a click change script example..

item 7854 When clicked changes to 7763 When clicked changes to 7869 When clicked changes to 7744 When clicked changes to 7854 And loops~
 
Well i guess 1 second delay. the 4 item Id's are basicly the Earth, ice, fiery, energy spike sword. the idea is simply to make it so when you Ctrl + Click the weapon, it swamps elements.
 
LUA:
-- credits to EvulMastah, i ask him because i get confused with the loop
local cfg = {
	[action] = { item1, item2, item3, item4 }
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local it = cfg[item.actionid]
	if(not(it))then
		return false
	end

	for i = 1, #it do
		if(item.itemid == it[i])then
			local new = (i == #it and 1 or i + 1)
			doTransformItem(item.uid, it[new])
			break
		end
	end

	return true
end
 
Back
Top