the ability i am trying to make is not working, please help me

chipakpaka

Member
i am trying to make an ability similar to the melee attack amy uses, but my script isn't working.

Lua:
addHook("SpinSpecial", function(player)
    for p in players.iterate
        if (p.mo.skin == "notTellingYou")
            if (p.cmd.buttons & BT_SPIN)
            p.momy = p.mindash*FRACUNIT
            p.momz = p.mindash*FRACUNIT
            end
        end
    end
end)

that is the code i made, and when i load it in the game it doesn't show any errors, but it doesn't do anything either. what should i do?
 
ok, i'll try that, thank you.

edit: so, i've added a "then" after "(p.cmd.buttons & BT_SPIN)" and it didn't do anything, but i decided to keep it in anyway just in case. anyway, i played around with the code using the wiki and came up with a new one, but that one gave me an error message as soon as i tried to use the ability.

here's the new code:
Lua:
addHook("SpinSpecial", function(player)
    for p in players.iterate
        if (p.mo.skin == "notTellingYou")
            if (p.cmd.buttons & BT_SPIN) then
            p.momy(p.mo, p.maxdash*FRACUNIT, true)
            p.pmomz(p.mo, p.mindash*FRACUNIT, true)
            end
        end
    end
end)

and the error message is attached.
 

Attachments

  • srb20001.jpg
    srb20001.jpg
    87.4 KB · Views: 32
Last edited:

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

Back
Top