thokito
New Member
- Joined
- Aug 11, 2011
- Messages
- 19
- Reaction score
- 0
I would like to improve this script and I'm not getting it.
This script works like this: you place an item on your arrows and get an outfit.
what I need is that when the player enters pz or changes outfit colors, the original outfit is restored.
This script works like this: you place an item on your arrows and get an outfit.
what I need is that when the player enters pz or changes outfit colors, the original outfit is restored.
Lua:
function onEquip(cid, item, slot)
local cfg = {
[128] = 369,
[136] = 370,
[129] = 371,
[130] = 373,
[131] = 375,
[132] = 377,
[133] = 379,
[134] = 381,
[135] = 371,
[137] = 372,
[138] = 374,
[139] = 376,
[140] = 378,
[141] = 380,
[142] = 382,
[143] = 383,
[144] = 385,
[145] = 387,
[146] = 389,
[147] = 384,
[148] = 386,
[149] = 388,
[150] = 390,
[151] = 391,
[152] = 368,
[153] = 395,
[154] = 397,
[155] = 392,
[156] = 394,
[157] = 396,
[158] = 398,
[366] = 414,
[367] = 413,
[335] = 411,
[336] = 412,
[324] = 410,
[325] = 409,
[288] = 408,
[289] = 407,
[278] = 405,
[279] = 406,
[268] = 401,
[269] = 402,
[270] = 404,
[273] = 403,
[251] = 399,
[252] = 400,
}
--[[
[128] = 389
[looktype current outfit] = looktype new outfit
]]
if getTilePzInfo(getPlayerPosition (cid)) then
print('pz')
doPlayerSendCancel(cid, "Você não pode equipar esse item no PZ.")
return
end
local p = getCreatureOutfit(cid)
local looktype = {
lookType = cfg[p.lookType],
lookHead = p.lookHead,
lookBody = p.lookBody,
lookLegs = p.lookLegs,
lookFeet = p.lookFeet,
lookAddons = p.lookAddons
}
if cfg[p.lookType] ~= nil then
doSetCreatureOutfit(cid, looktype, -1)
end
return true
end