-- Hi, FrivolousAqua here :wave:
-- Thought I might as well give a hand with the code since a softlock seems to occur
-- with weights above 9 (being stuck in an infinite spinout)

-- Overwrite these with your own numbers
local newspeed = 9
local newweight = 11
local softlockspin = (TICRATE * 2) / 35 -- this name sucks

addHook("PlayerThink", function(p)
    -- Don't process this stuff for the players that don't exist
    if not (p and p.valid) then return end
    if p.spectator then return end
    if not (p.mo and p.mo.valid) then return end
    
    -- Also, don't run this for anyone but Lucidiva
    if p.mo.skin != "pure_lucidiva" then return end
    
    -- At this point, the checks should've passed so that we are indeed Lucidiva
    -- In this case, set the speed and weight appropriately
    if p.kartspeed != newspeed or p.kartweight != neweight then
        p.kartspeed = newspeed
        p.kartweight = newweight
    end
    
    -- Whenever Lucidiva spins out, there's an issue that occurs with weights above 9.
    -- Essentially, interacting with lower weights can cause the spinout timer to underflow and effectively
    -- softlock the player.
    -- I imagine the formula looking something like this:
    -- your weight - 9 = weight maximum for softlocks
    -- This code presents a failsafe to prevent that.
    if p.mo.state == S_KART_SPINOUT and p.spinouttimer >= UINT16_MAX / 2 then
        p.spinouttimer = softlockspin
    end
end)