-- Continue State Switcher -- Made as a fun experiment & learning experience. -- Sorry for how busy the code is. I'm very much new to this. -- Special thanks to amperbee for helping me out with a few issues! -- And yes, I did ask ChatGPT for some help too... -- ~ MSF freeslot("S_PLAYCONT", "S_PLAYOWIE") states[S_PLAYCONT] = {SPR_PLAY,SPR2_CNT1|A,8,nil,0,0,S_PLAYCONT} states[S_PLAYOWIE] = {SPR_PLAY,SPR2_DEAD|A,8,nil,0,0,S_PLAYOWIE} local forceStop = false local hasCnt1 = "" local hasDead = "" local currentSkin = "" local isRSling = false local function skinChecker(player) if player.mo.skin ~= currentSkin then currentSkin = player.mo.skin hasCnt1 = P_IsValidSprite2(player.mo, SPR2_CNT1) hasDead = P_IsValidSprite2(player.mo, SPR2_DEAD) forceStop = not hasCnt1 and not hasDead end end local function switchState(player) if ((player.mo.state == S_PLAY_STND) or (player.mo.state == S_PLAY_WAIT) or (player.mo.state == S_PLAY_WALK) or (player.mo.state == S_PLAY_RUN) or (player.mo.state == S_PLAY_EDGE)) and P_IsObjectOnGround(player.mo) then if hasCnt1 then player.mo.state = S_PLAYCONT else player.mo.state = S_PLAYOWIE end elseif player.mo.state == S_PLAYCONT or player.mo.state == S_PLAYOWIE then player.mo.state = S_PLAY_STND end end addHook("MapLoad", function() if G_RingSlingerGametype() then isRSling = true else isRSling = false end end) addHook("PlayerThink", function(player) if (not isRSling) then for p in players.iterate do if not p.bot and not p.spectator and not p.togglecntoff then skinChecker(p) if not forceStop then if not (p.cmd.buttons & BT_FIRENORMAL) then p.conttapready = true p.conttapping = false elseif p.conttapready then p.conttapping = true p.conttapready = false else p.conttapping = false end if p.conttapping then switchState(p) end if p.mo.state == S_PLAYCONT or p.mo.state == S_PLAYOWIE then if p.speed > 1*FRACUNIT then p.pflags = $ | PF_STASIS else if P_GetPlayerControlDirection(p) ~= 0 then p.pflags = $ & ~ PF_STASIS p.mo.state = S_PLAY_WALK end end end if p.mo.state == S_PLAYCONT and not hasCnt1 then p.mo.state = S_PLAYOWIE elseif p.mo.state == S_PLAYOWIE and hasCnt1 then p.mo.state = S_PLAYCONT end if (p.mo.state == S_PLAYCONT or p.mo.state == S_PLAYOWIE) and not P_IsObjectOnGround(p.mo) then p.mo.state = S_PLAY_FALL end end end if p.togglecntoff and (p.mo.state == S_PLAYCONT or p.mo.state == S_PLAYOWIE) then p.pflags = $ & ~ PF_STASIS p.mo.state = S_PLAY_STND end end end end) local function ToggleCnt(player) if player.mo and player.mo.valid then if player.togglecntoff then player.togglecntoff = false CONS_Printf(player, "\x82"+"Continue State Switcher Enabled.") else player.togglecntoff = true CONS_Printf(player, "\x86"+"Continue State Switcher Disabled.") end else CONS_Printf (player, "\x85"+"You're not in a level!") end end COM_AddCommand("togglecnt", function(player) ToggleCnt(player) end) COM_AddCommand("togglecnt2", ToggleCnt, COM_SPLITSCREEN)