Jump to content

Recommended Posts

So, basically what i'd like to know if you can make multiple forms for a character, similar to the werebeaver, like if you eat a certain food, then you would transform into a form with a added meter along with all your others telling you how long this form would last, would you also be able to make multiple forms triggered by different items, and each one would have some sort of cooldown? 

  • Developer

Switching what your character or creature looks like is pretty easy code wise.  This snippet will switch between the different main players every second.

 

characters = { 'wes', 'wickerbottom', 'willow', 'wilson', 'wolfgang', 'woodie', 'wx78' }Assets = {} for i, c in ipairs( characters ) do    Assets[i] = Asset("ANIM", "anim/"..c..".zip")end  local character_index = 0local function SwitchCharacter()    local player = GLOBAL.GetPlayer()    if player then        character_index = character_index + 1        player.AnimState:SetBuild( characters[character_index] )        character_index = character_index % #characters    endend AddGamePostInit( function()    GLOBAL.scheduler:ExecutePeriodic( 1, SwitchCharacter ) end)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...