Lava Titan
Developer
heey <3
ok so, I'm working on making monsters for my server and obviously I don't know how every monster look-type looks like, normally I change all look-types by hand like
/newtype 1
/newtype 2
/newtype 3
/newtype 4
so I thought, why not make a script that changes these automatically, my issue is that the script stops when it reachs an invalid look-type
How can I make the script stop only when it reach look-type 367 but still avoid invalid look-types?
thanks in advance <3
ok so, I'm working on making monsters for my server and obviously I don't know how every monster look-type looks like, normally I change all look-types by hand like
/newtype 1
/newtype 2
/newtype 3
/newtype 4
so I thought, why not make a script that changes these automatically, my issue is that the script stops when it reachs an invalid look-type
How can I make the script stop only when it reach look-type 367 but still avoid invalid look-types?
Lua:
local invalidTypes = {
1, 135, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173,
174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188,
189, 190, 191
}
function onSay(player, words, param)
if not player:getGroup():getAccess() then
return true
end
local function changeLooktype(param)
local lookType = tonumber(param)
if lookType >= 0 and lookType < 368 and not table.contains(invalidTypes, lookType) then
local playerOutfit = player:getOutfit()
playerOutfit.lookType = lookType
player:setOutfit(playerOutfit)
addEvent(changeLooktype, 1000, param + 1)
else
player:sendCancelMessage("A look type with that id does not exist.")
end
end
addEvent(changeLooktype, 1000, param + 1)
return true
end
thanks in advance <3