View Single Post
Old 05-01-2016   #31
Zwip-Zwap Zapony
Please just call me Zappy.
 
Zwip-Zwap Zapony's Avatar
Default

Quote:
Originally Posted by Rumia1 View Post
clearly this script has no numbers in it, except MT_LASER
Exactly. MT_LASER is just a simple number. You should replace MT_LASER with the player's object, so it should look something like this:
Code:
addHook("MobjThinker", function(playermobj)
    local player = playermobj.player
    if playermobj.skin == "sonic"
        player.ability2 = CA2_NONE
        if player.cmd.buttons & BT_USE
            A_Boss1Laser(playermobj)
        end
    end
end, MT_PLAYER)
Untested, but I don't see why it shouldn't work. Though if you only plan on doing something for when holding spin, you might want to try out the SpinSpecial hook instead.
Edit: Also, looking at the source code for A_Boss1Laser, make sure to set the player's object's "target" variable to an object first, otherwise it won't do anything.

Last edited by Zwip-Zwap Zapony; 05-01-2016 at 12:53 PM.
Zwip-Zwap Zapony is offline   Reply With Quote