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

CreatureEvent Look type, for profession (to dragon ball, naruto or RPG OTS)

DanJ93

Member
Joined
Dec 25, 2008
Messages
212
Reaction score
19
config.lua
PHP:
allowChangeOutfit = false
data/creaturescripts/creaturescripts.xml
PHP:
	<event type="login" name="Outfitek" event="script" value="outfitek.lua"/>
data/creaturescripts/scripts/login.lua
PHP:
	registerCreatureEvent(cid, "Outfitek")
create outfitek.lua data/creaturescripts/

  • v1
PHP:
function onLogin(cid) 
local outfity = {
	[1] = {121},
	[2] = {122},
	[3] = {123}
				}
local i = 1, #outfity
if getPlayerVocation(cid) == outfity[i] then 
doSetCreatureOutfit(cid, outfity[i][1], -1) 
end 
return true 
end
[1], [2], [3] id profession
121, 122, 123 outfit for profession

  • v2
PHP:
function onLogin(cid) 
local outfity = {
	[1] = {121, 141},
	[2] = {122, 142},
	[3] = {123, 143}
				}
local i = 1, #outfity
if getPlayerVocation(cid) == outfity[i] then
if getPlayerSex(cid) == 1
doSetCreatureOutfit(cid, outfity[i][1], -1)
else
doSetCreatureOutfit(cid, outfity[i][2], -1)
end 
return true 
end
[1], [2], [3] id profession
121, 122, 123 outfit for male
141, 142, 143 outfits for female
 
Last edited:
not need to use 'for'

Lua:
function onLogin(cid)
local x = {
[1] = 121, -- sorc
[2] = 122, -- druid
[3] = 123 -- paladin
}
if (not x[getPlayerVocation(cid)]) then return true end
doSetCreatureOutfit(cid, {lookType = x[getPlayerVocation(cid)]}, -1) 
return true
end


Lua:
function onLogin(cid)  
local x = { 
    [1] = {121, 141}, 
    [2] = {122, 142}, 
    [3] = {123, 143} 
} 
if (not x[getPlayerVocation(cid)]) then return true end
doSetCreatureOutfit(cid, {lookType = getPlayerSex(cid) == 1 and x[getPlayerVocation(cid)][1] or x[getPlayerVocation(cid)][2]}, -1) 
return true
end
 
Lua:
local config =
{
	[1] = {male = 121, female = 141},
	[2] = {male = 122, female = 142}
}

function onLogin(cid)
	doSetCreatureOutfit(cid, config[getPlayerVocation(cid)][getPlayerSex(cid) == 1 and "male" or "female"], -1)
	return true
end
It's mine simple version :). Not tested.
 
or just set all outfits as quest ones and add only allowed for given vocation on first login
 
the same script can be modified to cooporse dead, meaning that another body at death has
 
Back
Top