dewral
Veteran OT User
- Joined
- Dec 4, 2019
- Messages
- 345
- Solutions
- 10
- Reaction score
- 371
Hello everyone!
Can someone give me a little hint how to make it work like
!outfit mummy
!outfit demon and etc.
I could just make it one by one but i wanna make it work with seperator and only 1 script xD
Can someone give me a little hint how to make it work like
!outfit mummy
!outfit demon and etc.
I could just make it one by one but i wanna make it work with seperator and only 1 script xD
Lua:
local outfitsRefuse = {135, {161, 191}}
local storage = 997997
local value = 1
local function isInAltArray(array, value)
for i = 1, #array do
if type(array[i]) == 'table' then
return (value < array[i][1] and value > array[i][2])
elseif array[i] == value then
return true
end
end
end
local function outfitSearch()
local outfit = 65
if not isInAltArray(outfitsRefuse, outfit) then
return outfit
end
return outfitSearch()
end
function onSay(player, words, param)
if player:getStorageValue(storage) ~= value then
player:sendTextMessage(MESSAGE_INFO_DESCR, "You don't have that command yet.")
player:getPosition():sendMagicEffect(CONST_ME_POFF)
return false
end
player:setOutfit({lookType = outfitSearch()})
player:getPosition():sendMagicEffect(CONST_ME_GROUNDSHAKER)
return false
end