• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Outfit changing without colors

BulawOw

Soul of Shinobi
Joined
Sep 15, 2014
Messages
204
Solutions
8
Reaction score
62
Code:
function onCastSpell(creature, variant)       


     local baseSpeed = creature:getVocation():getBaseSpeed()
     local speed = baseSpeed/2
     local prevOutfit = creature:getOutfit()

    if (prevOutfit.lookType == 904) then
            creature:setOutfit{ lookType = 912 }
            creature:changeSpeed(speed)
end

Like in title this script works fine but colors that i were using are not beging the same after transformation
Post automatically merged:

Got it fixed if anybody gonna have same problem there is my fix (yes i know it was obvious, but not for me :p)

LUA:
function onCastSpell(creature, variant)       


     local baseSpeed = creature:getVocation():getBaseSpeed()
     local speed = baseSpeed/2
     local prevOutfit = creature:getOutfit()
    

    if (prevOutfit.lookType == 904) then
            creature:setOutfit{ lookHead = prevOutfit.lookHead, lookLegs = prevOutfit.lookLegs, lookBody = prevOutfit.lookBody, lookFeet = prevOutfit.lookFeet, lookType = 912 }
            creature:changeSpeed(speed)
end
 
Last edited:
Back
Top