LUA HELP!!!

Void Animates

Just a guy who loves... EVERYTHING!
(PROBLEM SOLVED, SCROLL DOWN)
so uhh a little help.PNG

I haven't played SRB2 in a year, and I need help trying to remember lua, and stuff. I need tutorials for lua.
Also my character sprite is stuck in the ground, any tips on how to fix it?
I also need 3d model tutorials, put some good ones down here!
 
Last edited:
So, I was making code, during Dash Mode, if you press spin, you would dash forward like a spindash but almost instantly. This error popped up.
1688357373528.png

Here's the code:
Lua:
addHook("SpinSpecial", function(player)
        if player.mo.skin == "void"
        if (player.mo.state == S_PLAY_DASH)
        P_InstaThrust(player.mo, player.momz, 15*FRACUNIT)
        S_StartSound(player.mo, sfx_zoom)
        player.mo.state = S_PLAY_SPINDASH
        end
    end
end)
 
I need a bit of help, i dont really understand what fixed_t x, y and z.
Lua:
P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, MT_YELLOWSPRING)
I'm making a super smash bros sonic character.
Post automatically merged:

Lua:
addHook("PlayerThink", function(player)
            if player.mo.skin == "sonic"
            if (player.mo.state == S_PLAY_STAND)
            if (player.cmd.buttons & BT_CUSTOM1) then
            P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, MT_YELLOWSPRING)
            player.mo.momz = 15*FRACUNIT
            player.mo.state = S_PLAY_FALL
            end
        end
    end
end)

heres the code.
 
Last edited:
Maybe give it a bit of fixing


Example:
addHook("PlayerThink", function(player)
      if player.valid and player.playerstate == PST_LIVE
         and player.mo.skin == "sonic"
         and (player.pflags & PF_JUMPED)
         and (player.cmd.buttons & BT_CUSTOM1)
            local springspawn = P_SpawnMobjFromMobj(player.mo, 0, 0, 0, MT_YELLOWSPRING)
            springspawn.target = player.mo
            springspawn.fuse = TICRATE
            springspawn.dissappear = TICRATE
            springspawn.angle = player.drawangle
        end   
end)
 
Maybe give it a bit of fixing


Example:
addHook("PlayerThink", function(player)
      if player.valid and player.playerstate == PST_LIVE
         and player.mo.skin == "sonic"
         and (player.pflags & PF_JUMPED)
         and (player.cmd.buttons & BT_CUSTOM1)
            local springspawn = P_SpawnMobjFromMobj(player.mo, 0, 0, 0, MT_YELLOWSPRING)
            springspawn.target = player.mo
            springspawn.fuse = TICRATE
            springspawn.dissappear = TICRATE
            springspawn.angle = player.drawangle
        end
end)
oh thanks man! i'll try it, i'm kinda getting back into lua and i forgor..
 
Last edited:
oh thanks man! i'll try it, i'm kinda getting back into lua and i forgor..
Forgot to add in a bit, this ability can be enabled in ground.


It might have an effect on a recurl, so I might think you'll have to use what you have.


Instead of this obvoiusly, because It can not damage any monitor or enemy or boss.


Example (Fixed):
addHook("PlayerThink", function(player)
      if player.valid and player.playerstate == PST_LIVE
         and player.mo.skin == "sonic"
         and (player.pflags & PF_JUMPED)
         and (player.cmd.buttons & BT_CUSTOM1)
            local springspawn = P_SpawnMobjFromMobj(player.mo, 0, 0, 0, MT_YELLOWSPRING)
            springspawn.target = player.mo
            springspawn.fuse = TICRATE
            springspawn.dissappear = TICRATE
            springspawn.angle = player.drawangle
        end 
end)

addHook("PlayerThink", function(player)
      if player.valid and player.playerstate == PST_LIVE
         and player.mo.skin == "sonic"
         and (P_IsObjectOnGround(player.mo) or (player.mo.eflags & MFE_JUSTHITFLOOR))
         and (player.cmd.buttons & BT_CUSTOM1)
            local redspringspawn = P_SpawnMobjFromMobj(player.mo, 0, 0, 0, MT_REDSPRING)
            redspringspawn.target = player.mo
            redspringspawn.fuse = TICRATE
            redspringspawn.dissappear = TICRATE
            redspringspawn.angle = player.drawangle
        end 
end)
 
Last edited:

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

Back
Top