Jump to content

Recommended Posts

3 hours ago, caballi said:

How do I force my character to change with each passing day?
I'm having a hard time finding data because I'm not good at English.
If you can help me, I will thank you positively in any way. Please help me.

What do u want to change?
to another character?

I think you could make it through the seamlessplayerswapper component, something like:

local roles = {"wormwood", "wanda", "wendy"}

local function ChangeRole(inst)
    local current_role = inst.prefab
    local new_role = current_role

    -- make sure a different character
    while new_role == current_role do
        local index = math.random(#roles)
        new_role = roles[index]
    end

    inst.components.seamlessplayerswapper:_StartSwap(new_role)
end

local function OnDayComplete(inst)
    if inst == GLOBAL.ThePlayer then
        inst:DoTaskInTime(0, ChangeRole)
    end
end

AddPlayerPostInit(function(inst)
    inst:WatchWorldState("cycles", OnDayComplete)
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...