Giving Superforms Multiability

ZaWarudo11

Member
I want to give Sonic multithok upon turning super, and I only made this snippet of code
Lua:
    for player in players.iterate do
        if player.mo.skin == "sonic"
                and pw.powers == SF_SUPER
                player.flags == SF_MULTIABILITY
            end
        end
end)
and I don't think it'll work
How do I do it properly?
 
You need to add a hook and check userdata if you want to know when sonic in super use player.powers[pw_super]
Post automatically merged:

And player.pflags = SF_MULTIABILITY
Post automatically merged:

And you don't really need integrate do in hooks
Post automatically merged:

:worry:you at least tried good job:grin:
 
I want to give Sonic multithok upon turning super, and I only made this snippet of code
Lua:
    for player in players.iterate do
        if player.mo.skin == "sonic"
                and pw.powers == SF_SUPER
                player.flags == SF_MULTIABILITY
            end
        end
end)
and I don't think it'll work
How do I do it properly?
Corrected code:
addHook("PlayerThink", function(p) -- This is called a hook. You should use hooks for various stuff executing mid-game.
    if p.mo.skin == "sonic"
    and p.powers[pw_super] then -- You used p.powers incorrectly.
        p.flags = $ | SF_MULTIABILITY
    else
        p.flags = $ | ~SF_MULTIABILITY
    end
end)
 

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top