• 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 Spell - Change typeex

Carlitos Flow

Developer (lvl*1)
Joined
Mar 2, 2011
Messages
156
Solutions
4
Reaction score
10
Hello guys, im trying to create an spells for a monster called quest, it will change his looktype with my items, but i don't have idea how to create this, so... This is my script until now (i know it sucks but is only an example and idk how to set to the monster be an item).... TFS 0.3.6

Lua:
function onCastSpell(cid, var)
local itemids = {2492, 7415, 2160, 2159}
repeat rand = doSetItemOutfit(cid, item, time)
until rand ~= false
for i = math.random(#itemids) 
    return doSetItemOutfit(cid, itemids[i][1], 2000)
end
 
Last edited:
Solution
Try this one. I've never worked on old distros, but it should work.
Lua:
function onCastSpell(cid, var)
    local itemIds = {2492, 7415, 2160, 2159}
    doSetItemOutfit(cid, itemIds[math.random(#itemIds)], 2000)
end
Try this one. I've never worked on old distros, but it should work.
Lua:
function onCastSpell(cid, var)
    local itemIds = {2492, 7415, 2160, 2159}
    doSetItemOutfit(cid, itemIds[math.random(#itemIds)], 2000)
end
 
Solution
Back
Top