diff --git a/latest.lua b/latest.lua index 10bec60..f11fc09 100644 --- a/latest.lua +++ b/latest.lua @@ -4636,6 +4636,9 @@ CMDs[#CMDs + 1] = {NAME = 'norender', DESC = 'Disable 3d Rendering to decrease t CMDs[#CMDs + 1] = {NAME = 'render', DESC = 'Enable 3d Rendering'} CMDs[#CMDs + 1] = {NAME = 'use2022materials / 2022materials', DESC = 'Enables 2022 material textures'} CMDs[#CMDs + 1] = {NAME = 'unuse2022materials / un2022materials', DESC = 'Disables 2022 material textures'} +CMDs[#CMDs + 1] = {NAME = 'invincible', DESC = 'Prevents death by instantly restoring health'} +CMDs[#CMDs + 1] = {NAME = 'uninvincible', DESC = 'Removes invincibility and allows normal death'} +CMDs[#CMDs + 1] = {NAME = 'regen', DESC = 'Instantly regenerates full health'} -- New Dark Networks Commands CMDs[#CMDs + 1] = {NAME = 'nolighting / nolight', DESC = 'Disables all lighting in the game'} wait() @@ -8934,6 +8937,48 @@ addcmd('god',{},function(args, speaker) nHuman.Health = nHuman.MaxHealth end) + + +local InvinciblePlayers = {} -- Keeps track of players with invincibility enabled + +-- Invincible Command +addcmd('invincible', {'invi'}, function(args, speaker) + local Char = speaker.Character + local Human = Char and Char:FindFirstChildWhichIsA("Humanoid") + + if Human and not InvinciblePlayers[speaker] then + InvinciblePlayers[speaker] = Human -- Store the player's humanoid for tracking + + -- Continuous monitoring of player's health + task.spawn(function() + while InvinciblePlayers[speaker] and Human and Human.Parent do + if Human.Health <= 5 then -- If the player is about to die, restore full health + Human.Health = Human.MaxHealth + end + task.wait(0.1) -- Runs every 0.1 seconds + end + end) + end +end) + +-- Uninvincible Command +addcmd('uninvincible', {}, function(args, speaker) + if InvinciblePlayers[speaker] then + InvinciblePlayers[speaker] = nil -- Remove the player from tracking + end +end) + +-- Regen Command +addcmd('regen', {}, function(args, speaker) + local Char = speaker.Character + local Human = Char and Char:FindFirstChildWhichIsA("Humanoid") + + if Human then + Human.Health = Human.MaxHealth -- Instantly restores full health + end +end) + + invisRunning = false addcmd('invisible',{'invis'},function(args, speaker) if invisRunning then return end