• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Outfiter

Zysen

=)
Joined
Sep 18, 2010
Messages
2,270
Reaction score
170
Location
Bosnia & Herzegovina
Hello.I scripted an Outfiter.


How it works?

Pull the lever and change outfit!



data/actions/scripts/outfiter.lua

LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.actionid == 5888 then
		doPlayerSendTextMessage(cid,21,"Your outfit has been changed!")
                    doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_RED)
            doCreatureChangeOutfit(cid, {lookType = math.random(2, 333))
 end
    return true
end

actions.xml

XML:
<action itemid="5888" script="outfiter.lua"/>

Regards,
Zysen
 
Last edited:
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local v, tmp = math.random(333), getCreatureOutfit(cid)
	while isInArray({tmp.lookType, 75, 135, 266, 302}, v) == TRUE or v <= 1 or (v > 160 and v < 192) or v > 333 do
		v = math.random(351)
	end
 
	tmp.lookType = v
	doCreatureChangeOutfit(cid, tmp)
	doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_RED)
	doCreatureSay(cid, 'Your outfit has been changed.', TALKTYPE_ORANGE_1, false, cid, getThingPos(cid))
	return TRUE
end
Weak weak? :p
 
You have forgot a } here:
LUA:
            doCreatureChangeOutfit(cid, {lookType = math.random(2, 333))
 
Back
Top