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

Outfit Quest Chest problem

Zacky

New Member
Joined
Jan 7, 2011
Messages
55
Reaction score
0
Location
Zielona Góra
action.xml :
Code:
        <!-- Outfit Quest -->
        <action uniqueid="7012" event="script" value="quests/outfit.lua"/>
        <action uniqueid="7013" event="script" value="quests/outfit.lua"/>
        <action uniqueid="7014" event="script" value="quests/outfit.lua"/>
        <action uniqueid="7015" event="script" value="quests/outfit.lua"/>
        <action uniqueid="7016" event="script" value="quests/outfit.lua"/>
        <action uniqueid="7017" event="script" value="quests/outfit.lua"/>
        <action uniqueid="7018" event="script" value="quests/outfit.lua"/>
        <action uniqueid="7019" event="script" value="quests/outfit.lua"/>
        <action uniqueid="7020" event="script" value="quests/outfit.lua"/>
        <action uniqueid="7021" event="script" value="quests/outfit.lua"/>
        <action uniqueid="7022" event="script" value="quests/outfit.lua"/>

outfit.lua:
Code:
function onUse(cid, item, frompos, item2, topos)
    local script = {
                        [7011]={11, "Oriental"},
                        [7012]={12, "Pirate"},
                        [7013]={13, "Assassin"},
                        [7014]={14, "Beggar"},
                        [7015]={15, "Shaman"},
                        [7016]={16, "Norseman"},
                        [7017]={17, "Nightmare},
                        [7018]={18, "Jester"},
                        [7019]={19, "Brotherhood"},
                        [7020]={20, "Demonhunter"},
                        [7021]={21, "Yalaharian"},
                        [7022]={22, "Warmaster"},
                    }
                        
    if(canPlayerWearOutfitId(cid, script[item.uid][1], 3)) then
        doPlayerSendTextMessage(cid, 25, "You Already have the "..script[item.uid][2].." outfit!")
        return true
    end
        
    doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
    doPlayerSendTextMessage(cid, 21, "You now have the "..script[item.uid][2].." outfit!")
    doPlayerAddOutfitId(cid, script[item.uid][1], 3)    
    return true
    
end

When i set unique id in chest for example 7020 now it doesn't work...
Before a had such skript: (It was working....)
action.xml :
Code:
        <!-- Outfit Quest -->
        <action uniqueid="7020" event="script" value="quests/outfit.lua"/>

outfit.lua:
Code:
function onUse(cid, item, frompos, item2, topos)
    local script = {
                        [7020]={20, "Demonhunter"},
                    }
                        
    if(canPlayerWearOutfitId(cid, script[item.uid][1], 3)) then
        doPlayerSendTextMessage(cid, 25, "You Already have the "..script[item.uid][2].." outfit!")
        return true
    end
        
    doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
    doPlayerSendTextMessage(cid, 21, "You now have the "..script[item.uid][2].." outfit!")
    doPlayerAddOutfitId(cid, script[item.uid][1], 3)    
    return true
    
end

help me please :(
 
Lua:
local c = {
	[7011] = {11, "Oriental"},
	[7012] = {12, "Pirate"},
	[7013] = {13, "Assassin"},
	[7014] = {14, "Beggar"},
	[7015] = {15, "Shaman"},
	[7016] = {16, "Norseman"},
	[7017] = {17, "Nightmare"},
	[7018] = {18, "Jester"},
	[7019] = {19, "Brotherhood"},
	[7020] = {20, "Demonhunter"},
	[7021] = {21, "Yalaharian"},
	[7022] = {22, "Warmaster"}
}
function onUse(cid, item, frompos, item2, topos)
	local o = c[item.uid]
	if(canPlayerWearOutfitId(cid, o[1], 3)) then
		doPlayerSendTextMessage(cid, 25, "You Already have the "..o[2].." outfit!")
	else
		doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
		doPlayerSendTextMessage(cid, 21, "You now have the "..o[2].." outfit!")
		doPlayerAddOutfitId(cid, o[1], 3)
	end

	return true
end
 
Cleaner:
Lua:
local c = {"oriental","pirate","assassin","beggar","shaman","norseman","nightmare","jester","brotherhood","demonhunter","yalaharian","warmaster"}

function onUse(cid, item, frompos, item2, topos)
	local name = c[item.uid-7010]
	if(canPlayerWearOutfitId(cid, item.uid-7000, 3)) then
		doPlayerSendTextMessage(cid, 25, "You already have the "..name.." outfit!")
	else
		doSendMagicEffect(getCreaturePosition(cid), math.random(10, 13))
		doPlayerSendTextMessage(cid, 21, "You now have the "..name.." outfit!")
		doPlayerAddOutfitId(cid, item.uid-7000, 3)
	end

return true
end
 
Last edited:
Back
Top