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

[Request] When player click on item he get outfit

Status
Not open for further replies.

LoLaye

Active Member
Joined
Dec 23, 2008
Messages
3,774
Solutions
1
Reaction score
44
Location
Sweden
As the title say, i need a script that if a player click on a item with a special uniqueid he get a outfit added to hes outfits so if he change outfit he can still use the one he got using the item...

Sincerly,

Lolaye
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if (getPlayerStorageValue(cid, 4767) == EMPTY_STORAGE) then
		doCreatureSay(cid, "You have gained a new outfit!", TALKTYPE_ORANGE_1)
		doPlayerAddOutfit(cid, 333, 0)
		doPlayerAddOutfit(cid, 333, 0)
		setPlayerStorageValue(cid, 4767, 1)
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYDAMAGE)
	else
		doPlayerSendTextMessage(cid,22,"You have already gained your the outfit.")
	end
	return true
end
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if (getPlayerStorageValue(cid, 4767) == EMPTY_STORAGE) then
		doCreatureSay(cid, "You have gained a new outfit!", TALKTYPE_ORANGE_1)
		doPlayerAddOutfit(cid, 333, 0)
		doPlayerAddOutfit(cid, 333, 0)
		setPlayerStorageValue(cid, 4767, 1)
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYDAMAGE)
	else
		doPlayerSendTextMessage(cid,22,"You have already gained your the outfit.")
	end
	return true
end

Does this add the outfit in the outfits list?
 
Does this add the outfit in the outfits list?

It checks if the player has a certain storage value,
then it adds the same outfit in the outfit list TWICE??,
then it sets a certain storage value to the value 1.

If you want a temperoral use this script.

LUA:
local outfit =  createConditionObject(CONDITION_OUTFIT)
setConditionParam(outfit, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(outfit, {lookType = 353, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0})

function onUse(cid, item, fromPosition, itemEx, toPosition)
	addCondition(cid,outfit)
	doPlayerSendTextMessage(cid,20,'Your looktype has been changed.')
	doSendMagicEffect(getThingPos(cid),12)
	return true
end

Or if you want the one that adds the outfit to the outfit list use this.

LUA:
local config = {
	looktype_male = 100, -- looktype of the outfit for male.
	looktype_female = 101, -- looktype of the outfit for female
	addons = 0, -- how many addons you get.
	storage = 5012 -- storage value used.
	}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerStorageValue(cid,config.storage) < 1 then
		if getPlayerSex(cid) == 0 then
			doPlayerAddOutfit(cid,config.looktype_female,config.addons)
			doPlayerSendTextMessage(cid,20,'You got an outfit.')
			doSendMagicEffect(getThingPos(cid),12)
		elseif getPlayerSex(cid) == 1 then
			doPlayerAddOutfit(cid,config.looktype_male,config.addons)
			doPlayerSendTextMessage(cid,20,'You got an outfit.')
			doSendMagicEffect(getThingPos(cid),12)
		end
	else
		doPlayerSendTextMessage(cid,20,'You already have this outfit.')
		doSendMagicEffect(getThingPos(cid),2)
	end
	return true
end
 
Last edited:
@unknown666
It is supposed to give same outfit twice, just because of player's gender. Well, but not really same, there are different ids for males and females.
 
It checks if the player has a certain storage value,
then it adds the same outfit in the outfit list TWICE??,
then it sets a certain storage value to the value 1.

If you want a temperoral use this script.

LUA:
local outfit =  createConditionObject(CONDITION_OUTFIT)
setConditionParam(outfit, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(outfit, {lookType = 353, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0})

function onUse(cid, item, fromPosition, itemEx, toPosition)
	addCondition(cid,outfit)
	doPlayerSendTextMessage(cid,20,'Your looktype has been changed.')
	doSendMagicEffect(getThingPos(cid),12)
	return true
end

Or if you want the one that adds the outfit to the outfit list use this.

LUA:
local config = {
	looktype_male = 100, -- looktype of the outfit for male.
	looktype_female = 101, -- looktype of the outfit for female
	addons = 0, -- how many addons you get.
	storage = 5012 -- storage value used.
	}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerStorageValue(cid,config.storage) < 1 then
		if getPlayerSex(cid) == 0 then
			doPlayerAddOutfit(cid,config.looktype_female,config.addons)
			doPlayerSendTextMessage(cid,20,'You got an outfit.')
			doSendMagicEffect(getThingPos(cid),12)
		elseif getPlayerSex(cid) == 1 then
			doPlayerAddOutfit(cid,config.looktype_male,config.addons)
			doPlayerSendTextMessage(cid,20,'You got an outfit.')
			doSendMagicEffect(getThingPos(cid),12)
		end
	else
		doPlayerSendTextMessage(cid,20,'You already have this outfit.')
		doSendMagicEffect(getThingPos(cid),2)
	end
	return true
end

So you mean the second one will give you the outfit forever?
 
this is 100% work for tfs 0.3.6
Code:
local outfit = {lookType = 12, lookHead = 114, lookBody = 114, lookLegs = 0, lookFeet = 77, lookTypeEx = 0, lookAddons = 0}
local effect2 = 61
local effect3 = 61
local effect4 = 61
local effect = 61

	function onUse(cid, item, fromPosition, itemEx, toPosition) do
                doCreatureChangeOutfit(cid, outfit)
	        doSendMagicEffect(getCreaturePosition(cid), effect)
	        doSendMagicEffect(getCreaturePosition(cid), effect2)
	        doSendMagicEffect(getCreaturePosition(cid), effect3)
	        doSendMagicEffect(getCreaturePosition(cid), effect4)
		doPlayerSendTextMessage(cid,21,"Your outfit is changed!")
	end
    return true
end
 
what do you want? if it isn't in outfits.xml with default=0 they can't get there
and there is a limit you can't add all the outfits you want to outfit windows
 
Nah nevermind, my scripter told me that i cant put a monster outfit on the outfitlist, so he made a command for it, thanks for trying to help,

~Thread Closed~
 
LUA:
local config =  {
        looktype_male = 100, -- looktype of the outfit for male.
        looktype_female = 101, -- looktype of the outfit for female
        addons = 0, -- how many addons you get.
        storage = 5012 -- storage value used.
        }

function onUse(cid, item, fromPosition, itemEx, toPosition) return getPlayerStorageValue(cid, config.storage) < 1 and doPlayerAddOutfit(cid, ((getPlayerSex(cid) == 1) and config.looktype_female or config.looktype_male), config.addons) and doPlayerSendTextMessage(cid, 20, "You got an outfit.") and doSendMagicEffect(cid, 12) or doPlayerSendTextMessage(cid, 20, "You already have this outfit.") and doSendMagicEffect(cid, 2) and true end
 
Status
Not open for further replies.

Similar threads

Back
Top