-- COMMANDS -- -- ltoe: Enables this whole thing -- ltoe_time: Time between 60 [a minute] and 5, once this time runs out you die -- ltoe_lives: 0 gives you infinite lives, 1 gives you normal lives and 2 gives you a single life -- ltoe_stepitup: When enabled Tails will be faster -- ltoe_nothok: Disables thokking, since it can make the game mode boring local ltoe = true local ltoe_time = 25 local ltoe_lives = 1 local ltoe_stepitup = false local ltoe_nothok = false -- Adding the commands COM_AddCommand("ltoe", function(p, cmd) if cmd == nil if ltoe == false CONS_Printf(p, "\x82".."ltoe ".."\x80"..": Toggles Lose Tails Or Else when you have Tails as a bot partner. Currently off.") return else CONS_Printf(p, "\x82".."ltoe ".."\x80"..": Toggles Lose Tails Or Else when you have Tails as a bot partner. Currently on.") return end end local cmd_text = cmd:lower() local cmd_number = tonumber(cmd) if cmd_text == "on" or cmd_number == 1 ltoe = true CONS_Printf(p, "Lose Tails Or Else is enabled, and will start once you enter a level with Tails as your partner.") elseif cmd_text == "off" or cmd_number == 0 CONS_Printf(p, "Lose Tails Or Else was completely disabled.") ltoe = false else CONS_Printf(p, "ltoe: Invalid argument \'"..cmd.."\'. Please use \'0\'/\'1\' or \'On\'/\'Off\'") end end) COM_AddCommand("ltoe_time", function(p, cmd) if cmd == nil CONS_Printf(p, "\x82".."ltoe_time <10-60>".."\x80"..": Defines how many time do you have to escape from Tails. Currently "..ltoe_time..".") return end local cmd_number = tonumber(cmd) if cmd_number and cmd_number >= 10 and cmd_number <= 60 CONS_Printf(p, "Lose Tails Or Else's timer was set to "..cmd_number..".") ltoe_time = cmd_number else CONS_Printf(p, "ltoe_time: Invalid argument \'"..cmd.."\'. Please use a number from 10 to 60.") end end) COM_AddCommand("ltoe_lives", function(p, cmd) if cmd == nil if ltoe_lives == 0 CONS_Printf(p, "\x82".."ltoe_lives <0-2>".."\x80"..": 0 gives you infinite lives, 1 gives you normal lives and 2 gives you a single life. Only works when Lose Tails Or Else is on. Currently infinite.") return elseif ltoe_lives == 1 CONS_Printf(p, "\x82".."ltoe_lives <0-2>".."\x80"..": 0 gives you infinite lives, 1 gives you normal lives and 2 gives you a single life. Only works when Lose Tails Or Else is on. Currently normal.") else CONS_Printf(p, "\x82".."ltoe_lives <0-2>".."\x80"..": 0 gives you infinite lives, 1 gives you normal lives and 2 gives you a single life. Only works when Lose Tails Or Else is on. Currently a single life.") end end local cmd_number = tonumber(cmd) if cmd_number == 0 CONS_Printf(p, "Lose Tails Or Else's life option was set to infinite lives.") ltoe_lives = 0 elseif cmd_number == 1 CONS_Printf(p, "Lose Tails Or Else's life option was set to normal lives.") ltoe_lives = 1 elseif cmd_number == 2 CONS_Printf(p, "Lose Tails Or Else's life option was set to a single life.") ltoe_lives = 2 else CONS_Printf(p, "ltoe_lives: Invalid argument \'"..cmd.."\'. Please use a number from 0 to 2.") end end) COM_AddCommand("ltoe_stepitup", function(p, cmd) if cmd == nil if ltoe_stepitup == false CONS_Printf(p, "\x82".."ltoe_stepitup ".."\x80"..": Makes Tails faster when Lose Tails Or Else is on. Currently off.") return else CONS_Printf(p, "\x82".."ltoe_stepitup ".."\x80"..": Makes Tails faster when Lose Tails Or Else is on. Currently on.") return end end local cmd_text = cmd:lower() local cmd_number = tonumber(cmd) if cmd_text == "on" or cmd_number == 1 ltoe_stepitup = true CONS_Printf(p, "Tails will now be faster with Lose Tails Or Else.") elseif cmd_text == "off" or cmd_number == 0 CONS_Printf(p, "Tails will now keep his regular speed.") ltoe_stepitup = false else CONS_Printf(p, "ltoe_stepitup: Invalid argument \'"..cmd.."\'. Please use \'0\'/\'1\' or \'On\'/\'Off\'") end end) COM_AddCommand("ltoe_nothok", function(p, cmd) if cmd == nil if ltoe_nothok == false CONS_Printf(p, "\x82".."ltoe_nothok ".."\x80"..": Disables any thok abilities when Lose Tails Or Else is on. Currently off.") return else CONS_Printf(p, "\x82".."ltoe_nothok ".."\x80"..": Disables any thok abilities when Lose Tails Or Else is on. Currently on.") return end end local cmd_text = cmd:lower() local cmd_number = tonumber(cmd) if cmd_text == "on" or cmd_number == 1 ltoe_nothok = true CONS_Printf(p, "Thok abilities will now be disabled with Lose Tails Or Else.") elseif cmd_text == "off" or cmd_number == 0 CONS_Printf(p, "Thok abilities may now be freely used.") ltoe_nothok = false else CONS_Printf(p, "ltoe_nothok: Invalid argument \'"..cmd.."\'. Please use \'0\'/\'1\' or \'On\'/\'Off\'") end end) local ltoe_boss = false -- first of all we need to know if it's a boss level addHook("MapLoad", function(map) for mo in mobjs.iterate() if mo.flags & MF_BOSS ltoe_boss = true --print("oh shit there boss cancel operation") break else --print("no boss, ltoe can proceed normally") ltoe_boss = false end end end) -- Main function addHook("BotTiccmd", function(botplayer, cmd) local player = players[0].mo local bot = botplayer.mo if bot.traptime == nil bot.traptime = 0 end --print("trap time is "..bot.traptime/TICRATE.." seconds.") if bot.traptime >= 3*TICRATE --print("we out") player.player.exiting = 3 end if ltoe and not ltoe_boss if not ltoe_lives --print("infinite lives") player.player.lives = -1 elseif ltoe_lives == 2 and player.player.lives > 1 --print("single life") player.player.lives = 1 end if ltoe_stepitup --print("speed me up") bot.player.normalspeed = skins[bot.skin].normalspeed*(3/2) else --print("slow ass bitch") bot.player.normalspeed = skins[bot.skin].normalspeed end if ltoe_nothok if player.player.charability == CA_THOK or player.player.charability == CA_JUMPTHOK or player.player.charability == CA_HOMINGTHOK player.player.charability = CA_NONE --print("no thok bitch") end elseif player.player.charability == CA_NONE player.player.charability = skins[player.skin].ability --print("return to thokker") end if player.state == S_PLAY_DEAD or player.state == S_PLAY_DRWN player.dying = true elseif P_IsObjectOnGround(player) player.dying = false end -- usual respawn check but in Lua if not P_CheckSight(player, bot) and P_AproxDistance(P_AproxDistance(bot.x-player.x, bot.y-player.y), bot.z-player.z) > FixedMul(1024*FRACUNIT, bot.scale) and bot.player.bot == 1 -- checking if the bot is actually a bot and not player.dying --print("increase trap time pls") bot.traptime = $+1 else if ltoe_time player.toim = ltoe_time else player.toim = 25 end if players[0].realtime >= player.toim*TICRATE -- else if the set time has passed and bot.player.bot == 1 -- another bot check --print("oops you are dead") P_DamageMobj(player, nil, nil, 1, DMG_INSTAKILL) -- you are dead not big surprise elseif bot.traptime > 0 --print("decrease trap time pls") bot.traptime = $-1 end end end end, "tails") -- exclusive to Tails of course -- no normal bot respawning addHook("BotRespawn", function(player, bot) if bot -- you must exist bruh and bot.skin == "tails" -- Tails exclusive again and bot.player.bot == 1 -- is he bot return false -- no respawning for you end end)