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

Lua doCreatureChangeOutfit - Basic Question

Gabriel Tibiano

New Member
Joined
Nov 21, 2009
Messages
420
Reaction score
4
My question is about this function

Lua:
doCreatureChangeOutfit(cid, outfit)


What i've to do to get the colors from PlayerOutfit?

something like this:

Lua:
			local outfit = {lookType = 136, lookHead = GET_PLAYER_COLOR, lookBody =  GET_PLAYER_COLOR, lookLegs =  GET_PLAYER_COLOR, lookFeet =  GET_PLAYER_COLOR, lookAddons = 3}


or maybe like this:

Lua:
local val = db.getResult("SELECT `lookHead` FROM `players` WHERE `id` = "..getPlayerGUID(cid)..";")

local outfit = {lookType = 136, lookHead = val:getDataString("lookHead")}


Anyone could help me?
 
Last edited:
Lua:
local outfit = {lookType = 136, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet, lookAddons = 3}
 
I have a problem. I made a script that when I "use" an item, it transform me in a Orc, but dind't work.

Error:
[01/11/2011 16:19:10] [Error - Action Interface]
[01/11/2011 16:19:10] data/actions/scripts/dead_orc.lua:eek:nUse
[01/11/2011 16:19:10] Description:
[01/11/2011 16:19:10] attempt to index a number value
[01/11/2011 16:19:10] stack traceback:
[01/11/2011 16:19:10] [C]: in function 'doSetCreatureOutfit'
[01/11/2011 16:19:10] data/actions/scripts/dead_orc.lua:7: in function <data/actions/scripts/dead_orc.lua:3>

It's my script:
local orc = {x=31968, y=32152, z=7}

function onUse(cid, item, fromPosition, itemEx, toPosition)

if (item.itemid == 3080) then

doSetCreatureOutfit(cid, 5,120)
doSendMagicEffect(orc, 3)

end
return true

end
 
Back
Top