--if you are using this in a mod, give credits please, i putted some hard work on this --btw the code is extra messy and i don't want to risk to edit it --some stuff is commented out so i can use them in a possible future update --in some of this stuff i was helped, by cool people like Golden, Amperbee, CloneFighter and Speccy, they are not part of the project but i wanted to let you aknowledge their importance in this --also thanks to youngod for letting me know about destscale print("è ") print("èooo cool momentum mod you got there") print("ècan i have it?") print("è ") addHook("PlayerThink", function(player) if player.mo.state == S_PLAY_DEAD and player.mo.momz < 1 player.mo.state = S_PLAY_DRWN end end) addHook("AbilitySpecial", function(player) if player.mo and player.mo.valid and player.charability == CA_THOK and not (player.pflags & PF_THOKKED) P_InstaThrust(player.mo, player.mo.angle, 40*FRACUNIT + player.speed/4) P_SetObjectMomZ(player.mo, player.speed/10, true) P_SpawnThokMobj(player) S_StartSound(player.mo, sfx_thok) player.pflags = $|PF_THOKKED end end) addHook("PlayerThink", function(player) if player.speed > skins[player.realmo.skin].normalspeed - 2*FRACUNIT if player.mo.skin == "adventuresonic" then return end --chad adventure sonic already has momentum if player.speed < 150*player.mo.scale --speed cap because you could noclip to the backrooms if you go 2 fest -- P_Thrust(player.mo, player.drawangle, player.speed/11) /* local society = P_SpawnGhostMobj(player.mo) society.blendmode = AST_ADD society.fuse = 2 */ player.mo.friction = FRACUNIT end if (not player.cmd.buttons) and (player.cmd.forwardmove == 0) and (player.cmd.sidemove == 0) --thanks speccy player.mo.friction = 59392 end end if player.mo and not (player.pflags & PF_JUMPED) and player.cmd.buttons & BT_USE and (player.mo.state == S_PLAY_SPRING or player.mo.state == S_PLAY_FALL) player.pflags = $ | PF_JUMPED player.mo.state = S_PLAY_ROLL S_StartSound(player.mo, sfx_zoom, player) P_SpawnThokMobj(player) end if (player.charability == CA_TWINSPIN and player.charability2 == CA2_MELEE) and (player.mo.state == S_PLAY_FALL or player.mo.state == S_PLAY_SPRING) player.pflags = ($|PF_JUMPED|PF_NOJUMPDAMAGE) end end) addHook("ThinkFrame", do for player in players.iterate do if player.mo and player.mo.valid if player.mo.skin == "adventuresonic" then return end if (player.mo.state == S_PLAY_WALK or player.mo.state == S_PLAY_RUN or player.mo.state == S_PLAY_SKID) and player.mo.momz > 0 and not P_IsObjectOnGround(player.mo) and not player.powers[pw_carry] player.mo.state = S_PLAY_SPRING end if (player.mo.state == S_PLAY_WALK or player.mo.state == S_PLAY_RUN or player.mo.state == S_PLAY_SKID) and player.mo.momz < 1 and not P_IsObjectOnGround(player.mo) and not player.powers[pw_carry] player.mo.state = S_PLAY_FALL end end end end) addHook("MobjMoveBlocked", function(mo) local player = mo.player if (player.pflags & PF_SPINNING) and player.speed > 5*FRACUNIT and player.mo.momz < 1 P_SetObjectMomZ(player.mo, player.speed/4, true) --P_InstaThrust(player.mo, player.mo.angle, -player.speed/2) end end, MT_PLAYER) addHook("PlayerThink", function(player) if player.charability2 == CA2_SPINDASH player.spinitem = 0 end if player.pflags & PF_SPINNING and not (player.mo.eflags & MFE_VERTICALFLIP) and not (player.pflags & PF_JUMPED) and player.speed > 1*FRACUNIT local industrialsociety = P_SpawnMobj(player.mo.x, player.mo.y, player.mo.z, MT_GHOST) industrialsociety.z = player.mo.z - player.mo.scale*16/3 industrialsociety.fuse = 8 industrialsociety.destscale = 0 industrialsociety.state = S_THOK industrialsociety.color = player.mo.color industrialsociety.flags = $|MF_NOCLIPHEIGHT end if player.pflags & PF_SPINNING and not (player.pflags & PF_JUMPED) and player.speed > 1*FRACUNIT and (player.mo.eflags & MFE_VERTICALFLIP) local industrialsociety = P_SpawnMobj(player.mo.x, player.mo.y, player.mo.z, MT_GHOST) industrialsociety.z = player.mo.z + player.mo.scale*16/3 - player.mo.height/2 industrialsociety.fuse = 8 industrialsociety.destscale = 0 industrialsociety.state = S_THOK industrialsociety.color = player.mo.color industrialsociety.flags = $|MF_NOCLIPHEIGHT end /* if player.mo.valid local bozo = player.speed/FRACUNIT local fov = CV_FindVar("fov") CV_Set(fov, bozo/4 + 90) end */ if not(player.mo) then return end if (P_IsObjectOnGround(player.mo)) and (player.mo.state == S_PLAY_SPINDASH) player.charflags = $1|SF_NOSPINDASHDUST --P_SpawnSkidDust(player, 13*FRACUNIT, sfx_none) local dust = P_SpawnMobjFromMobj(player.realmo, P_RandomRange(-6, 6) * FRACUNIT, P_RandomRange(-6, 6) * FRACUNIT, 0, MT_DUST) dust.momx = P_RandomRange(-4, 4)*FRACUNIT dust.momy = P_RandomRange(-4, 4)*FRACUNIT dust.momz = P_RandomRange(0, 4)*FRACUNIT dust.destscale = 4*FRACUNIT P_InstaThrust(dust, player.mo.angle, -4*FRACUNIT) end if (player.cmd.buttons & (BT_TOSSFLAG|BT_CUSTOM1)) == BT_TOSSFLAG|BT_CUSTOM1 --thanks to clone fighter and speccy and not player.weapondelay player.mo.digtimer = 25 player.weapondelay = 2*TICRATE player.mo.state = S_PLAY_GASP S_StartSound(player.mo, sfx_cdpcm3) end if (player.cmd.buttons & (BT_CUSTOM2|BT_CUSTOM3)) == BT_CUSTOM2|BT_CUSTOM3 --thanks to clone fighter and speccy and not player.weapondelay player.mo.digtimer = 25 player.weapondelay = 2*TICRATE player.mo.state = S_PLAY_GASP S_StartSound(player.mo, sfx_cdpcm5) end end) local timeme = 0 addHook("PlayerThink", function(player) if not player.mo.skin == "sonic" or player.mo.skin == "cdsonic" or player.mo.skin == "altsonic" or player.mo.skin == "sunky" then return end if not (player.mo.state == S_PLAY_STND or player.mo.state == S_PLAY_WAIT) timeme = 0 end if (player.mo.state == S_PLAY_WAIT or player.mo.state == S_PLAY_STND) timeme = $ + 1 end if timeme == 3*60*TICRATE and player.playerstate == PST_LIVE P_DamageMobj(player.mo, nil, nil, 1, DMG_INSTAKILL) player.mo.state = S_PLAY_FALL S_StartSound(player.mo, sfx_cdpcm3) player.lives = 0 --IM FUCKING EVIL HAHAHAHAHAHAHAHAHHAHAHHAHAHAHAHAHAHHAHAHAHHAHAHHAHAHAHAHAHHAHAHAHHAHHAAHHAHAHAH end end)