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

Help with this script please!

kird

New Member
Joined
Jul 3, 2010
Messages
78
Reaction score
1
Well, im trying to make a script that after useing an item, the player will get an outfit for 20 sec.
But i just cant make it work
All the other code apprt from the doCombat function inside onUse works, but it doesnt change the outfit
Help please, what am i doing wrong

Code:
local combat =  createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)

local outfit = createConditionObject(CONDITION_OUTFIT)
setConditionParam(outfit, CONDITION_PARAM_TICKS, 20000)
addOutfitCondition(outfit, {lookTypeEx = 0, lookType = 128, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94,lookAddons = 0})
setCombatCondition(combat, outfit)

function onUse(cid, var)
        doCombat(cid, combat, var)
        return true
end
 
Try this and let me know if anything happens:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local outfit = createConditionObject(CONDITION_OUTFIT)
	setConditionParam(outfit, CONDITION_PARAM_TICKS, 20000)
	addOutfitCondition(outfit, {lookTypeEx = 0, lookType = 128, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94,lookAddons = 0})
	addCondition(cid, outfit)
return true
end
the previous code was wrong 'function onUse(cid, var?)' you need to use
'function onUse(cid, item, fromPosition, itemEx, toPosition)'
this is an action script, so it's different.
 
shorter?
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
   doSetCreatureOutfit(cid, outfit, time)
return true
end
 
omg i forgot
LUA:
local outfit = {lookTypeEx = 0, lookType = 128, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94,lookAddons = 0}

function onUse(cid, item, fromPosition, itemEx, toPosition)
   doSetCreatureOutfit(cid, outfit, 20*1000)
   doRemoveItem(item.uid, 1)
return true
end
 
Thank you guys for you replies, what i rlly want to do is an OB System, each team will get teleported to the fight area, and i want to set their outfits to a certain color, but with the additional condition that they cant change it during the OB time.
How can i do so they aren't able to change their outfits during, (for example) while a certain storage value is set to 1?

If i use the doSetCreatureOutfit function the outfit will disappear after the time is complete, i dont want that.
Else, if i use the the "set outfit function" (sry i dont remember it since im at university), they'll be able to change it during the OB, i dont want that either.

SO, any suggestion?
Doesn't matter if i have to modify the source.

Thnx in advance

Kird~
 
Last edited:
Back
Top