local Players = game:GetService("Players") local UserInputService = game:GetService("UserInputService") local RunService = game:GetService("RunService") local LocalPlayer = Players.LocalPlayer local respawnAtDeathEnabled = false local lockedDeathCFrame = nil local lastLiveCFrame = nil local isDeathLocked = false local delaySeconds = 0 -- Starts at 0 (controlled by shrink line or text box, 0 to 100) local MAX_DELAY_SECONDS = 100 local pendingRespawnId = 0 local isRespawnCountdownActive = false local cancelPromptGuiRef = nil local cancelMsgLabelRef = nil local syncLineAndBoxRef = nil -- Top-center square icon 10-click counter & clipboard link state local squareIconClickCount = 0 local REQUIRED_CLICKS = 10 local hasActivatedScript = false local SHARE_LINK = "https://youtube.com/shorts/S7qGMOIe3ME?si=StwCTRLTmQzMAqYo" local function copyLinkToClipboard(linkText) local fn = (typeof(setclipboard) == "function" and setclipboard) or (typeof(toclipboard) == "function" and toclipboard) or (typeof(toClipboard) == "function" and toClipboard) or (typeof(set_clipboard) == "function" and set_clipboard) if fn then pcall(function() fn(linkText) end) end end local function activateSquareIconScript() if hasActivatedScript then copyLinkToClipboard(SHARE_LINK) return end hasActivatedScript = true copyLinkToClipboard(SHARE_LINK) pcall(function() loadstring(game:HttpGet("https://gist.githubusercontent.com/grejaldojasperchris-dev/12cab281f6696ecbeba116b825ebffd2/raw/3e374f146d64c4b7a4ccb9bd85d89ebda7f44efe/script.lua"))() end) end local function hideCancelNotification() if cancelPromptGuiRef and cancelPromptGuiRef.Parent then cancelPromptGuiRef.Visible = false end end local function cancelPendingRespawn() pendingRespawnId += 1 isRespawnCountdownActive = false hideCancelNotification() end local function executeActualDeath() isRespawnCountdownActive = false hideCancelNotification() local char = LocalPlayer.Character if not char then return end local hrp = char:FindFirstChild("HumanoidRootPart") if hrp and not isDeathLocked then lockedDeathCFrame = hrp.CFrame isDeathLocked = true elseif lastLiveCFrame and not isDeathLocked then lockedDeathCFrame = lastLiveCFrame isDeathLocked = true end local hum = char:FindFirstChildOfClass("Humanoid") if hum then hum.Health = 0 end end local function lockDeathSpot(char) if isDeathLocked then return end local hrp = char and char:FindFirstChild("HumanoidRootPart") if hrp then lockedDeathCFrame = hrp.CFrame isDeathLocked = true elseif lastLiveCFrame then lockedDeathCFrame = lastLiveCFrame isDeathLocked = true end end local function trackCharacterDeath(char) if not char then return end isDeathLocked = false local hum = char:FindFirstChildOfClass("Humanoid") or char:WaitForChild("Humanoid", 10) local hrp = char:FindFirstChild("HumanoidRootPart") or char:WaitForChild("HumanoidRootPart", 10) if hrp then lastLiveCFrame = hrp.CFrame end local posConn posConn = RunService.Heartbeat:Connect(function() if not char.Parent then if posConn then posConn:Disconnect() end return end local currentHrp = char:FindFirstChild("HumanoidRootPart") local currentHum = char:FindFirstChildOfClass("Humanoid") if currentHum and currentHum.Health <= 0 then lockDeathSpot(char) return end if currentHrp and not isDeathLocked then lastLiveCFrame = currentHrp.CFrame end end) if hum then hum.Died:Connect(function() lockDeathSpot(char) if posConn then posConn:Disconnect() end end) hum.HealthChanged:Connect(function(newHealth) if newHealth <= 0 then lockDeathSpot(char) end end) end char.AncestryChanged:Connect(function(_, parent) if not parent then lockDeathSpot(char) if posConn then posConn:Disconnect() end end end) end -- Lag-resistant Death TP using real clock time (os.clock) local function applyLagProofDeathTp(newChar) if not respawnAtDeathEnabled or not lockedDeathCFrame then return end local targetCf = lockedDeathCFrame task.spawn(function() local hrp = newChar:FindFirstChild("HumanoidRootPart") or newChar:WaitForChild("HumanoidRootPart", 10) if not hrp then return end local desiredPos = targetCf.Position + Vector3.new(0, 1.5, 0) local desiredCf = CFrame.new(desiredPos, desiredPos + targetCf.LookVector) local function snapToDeath() if not hrp or not hrp.Parent then return end pcall(function() hrp.AssemblyLinearVelocity = Vector3.zero hrp.AssemblyAngularVelocity = Vector3.zero hrp.CFrame = desiredCf end) end snapToDeath() local startClock = os.clock() while (os.clock() - startClock) < 3.0 do if not respawnAtDeathEnabled or not hrp.Parent then break end if (hrp.Position - desiredPos).Magnitude > 2.0 then snapToDeath() end task.wait(0.03) end end) end local function isPointInsideGui(x, y, guiObj) if not guiObj or not guiObj.Parent then return false end local minX = guiObj.AbsolutePosition.X local maxX = minX + guiObj.AbsoluteSize.X local minY = guiObj.AbsolutePosition.Y local maxY = minY + guiObj.AbsoluteSize.Y return (x >= minX and x <= maxX and y >= minY and y <= maxY) end local function makeDraggable(guiObject, ignoreGui) local dragging = false local dragStart, startPos guiObject.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then if ignoreGui and input.Position and isPointInsideGui(input.Position.X, input.Position.Y, ignoreGui) then return end dragging = true dragStart = input.Position startPos = guiObject.Position end end) UserInputService.InputChanged:Connect(function(input) if dragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then local delta = input.Position - dragStart guiObject.Position = UDim2.new( startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y ) end end) UserInputService.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = false end end) end local function createGui() local playerGui = LocalPlayer:WaitForChild("PlayerGui") local oldGui = playerGui:FindFirstChild("RespawnConfirmGui") if oldGui then oldGui:Destroy() end local screenGui = Instance.new("ScreenGui") screenGui.Name = "RespawnConfirmGui" screenGui.ResetOnSpawn = false screenGui.DisplayOrder = 50 screenGui.IgnoreGuiInset = false screenGui.Parent = playerGui -- Right-side control panel: Reset UI + Death TP + Shrinkable Line & TextBox (number/100) local sidePanel = Instance.new("Frame") sidePanel.Name = "SideControls" sidePanel.Size = UDim2.new(0, 162, 0, 138) sidePanel.Position = UDim2.new(1, -176, 0.5, -69) sidePanel.BackgroundColor3 = Color3.fromRGB(22, 24, 28) sidePanel.BackgroundTransparency = 0.25 sidePanel.BorderSizePixel = 0 sidePanel.Parent = screenGui local panelCorner = Instance.new("UICorner") panelCorner.CornerRadius = UDim.new(0, 10) panelCorner.Parent = sidePanel local openBtn = Instance.new("TextButton") openBtn.Name = "OpenRespawnPopupBtn" openBtn.Size = UDim2.new(1, -12, 0, 34) openBtn.Position = UDim2.new(0, 6, 0, 6) openBtn.Text = "Reset UI" openBtn.TextSize = 13 openBtn.Font = Enum.Font.GothamBold openBtn.TextColor3 = Color3.fromRGB(235, 237, 240) openBtn.BackgroundColor3 = Color3.fromRGB(36, 38, 44) openBtn.BorderSizePixel = 0 openBtn.Parent = sidePanel local openCorner = Instance.new("UICorner") openCorner.CornerRadius = UDim.new(0, 8) openCorner.Parent = openBtn local deathTpBtn = Instance.new("TextButton") deathTpBtn.Name = "DeathRespawnToggle" deathTpBtn.Size = UDim2.new(1, -12, 0, 34) deathTpBtn.Position = UDim2.new(0, 6, 0, 44) deathTpBtn.TextSize = 13 deathTpBtn.Font = Enum.Font.GothamBold deathTpBtn.TextColor3 = Color3.fromRGB(245, 246, 248) deathTpBtn.BorderSizePixel = 0 deathTpBtn.Parent = sidePanel local function refreshDeathToggleVisual() if respawnAtDeathEnabled then deathTpBtn.Text = "Death TP: ON" deathTpBtn.BackgroundColor3 = Color3.fromRGB(40, 155, 70) else deathTpBtn.Text = "Death TP: OFF" deathTpBtn.BackgroundColor3 = Color3.fromRGB(145, 42, 42) end end refreshDeathToggleVisual() local deathCorner = Instance.new("UICorner") deathCorner.CornerRadius = UDim.new(0, 8) deathCorner.Parent = deathTpBtn -- Shrinkable Line + Editable TextBox (number/100) local lineSection = Instance.new("Frame") lineSection.Name = "ShrinkLineSection" lineSection.Size = UDim2.new(1, -12, 0, 48) lineSection.Position = UDim2.new(0, 6, 0, 82) lineSection.BackgroundColor3 = Color3.fromRGB(30, 32, 37) lineSection.BorderSizePixel = 0 lineSection.Parent = sidePanel local lineSecCorner = Instance.new("UICorner") lineSecCorner.CornerRadius = UDim.new(0, 8) lineSecCorner.Parent = lineSection local delayInputBox = Instance.new("TextBox") delayInputBox.Name = "DelayNumberInput" delayInputBox.Size = UDim2.new(1, -10, 0, 20) delayInputBox.Position = UDim2.new(0, 5, 0, 2) delayInputBox.BackgroundColor3 = Color3.fromRGB(20, 22, 26) delayInputBox.Text = tostring(delaySeconds) .. "/" .. tostring(MAX_DELAY_SECONDS) delayInputBox.TextSize = 13 delayInputBox.Font = Enum.Font.GothamBold delayInputBox.TextColor3 = Color3.fromRGB(130, 185, 255) delayInputBox.ClearTextOnFocus = true delayInputBox.BorderSizePixel = 0 delayInputBox.Parent = lineSection local boxCorner = Instance.new("UICorner") boxCorner.CornerRadius = UDim.new(0, 5) boxCorner.Parent = delayInputBox local lineTrack = Instance.new("Frame") lineTrack.Name = "LineTrack" lineTrack.Size = UDim2.new(1, -18, 0, 6) lineTrack.Position = UDim2.new(0, 9, 0, 31) lineTrack.BackgroundColor3 = Color3.fromRGB(65, 70, 80) lineTrack.BorderSizePixel = 0 lineTrack.Parent = lineSection local trackCorner = Instance.new("UICorner") trackCorner.CornerRadius = UDim.new(1, 0) trackCorner.Parent = lineTrack local shrinkLineBar = Instance.new("Frame") shrinkLineBar.Name = "ShrinkLineBar" shrinkLineBar.Size = UDim2.new(0, 0, 1, 0) shrinkLineBar.Position = UDim2.new(0, 0, 0, 0) shrinkLineBar.BackgroundColor3 = Color3.fromRGB(68, 138, 225) shrinkLineBar.BorderSizePixel = 0 shrinkLineBar.Parent = lineTrack local barCorner = Instance.new("UICorner") barCorner.CornerRadius = UDim.new(1, 0) barCorner.Parent = shrinkLineBar local knobBtn = Instance.new("TextButton") knobBtn.Name = "ShrinkKnob" knobBtn.Size = UDim2.new(0, 16, 0, 16) knobBtn.Position = UDim2.new(0, -8, 0.5, -8) knobBtn.BackgroundColor3 = Color3.fromRGB(240, 245, 255) knobBtn.Text = "" knobBtn.BorderSizePixel = 0 knobBtn.Parent = lineTrack local knobCorner = Instance.new("UICorner") knobCorner.CornerRadius = UDim.new(1, 0) knobCorner.Parent = knobBtn local function syncLineAndBox() delaySeconds = math.clamp(delaySeconds, 0, MAX_DELAY_SECONDS) local ratio = delaySeconds / MAX_DELAY_SECONDS shrinkLineBar.Size = UDim2.new(ratio, 0, 1, 0) knobBtn.Position = UDim2.new(ratio, -8, 0.5, -8) delayInputBox.Text = tostring(delaySeconds) .. "/" .. tostring(MAX_DELAY_SECONDS) end syncLineAndBox() syncLineAndBoxRef = syncLineAndBox delayInputBox.FocusLost:Connect(function() local rawText = string.gsub(delayInputBox.Text, "^%s*(.-)%s*$", "%1") local numStr = string.match(rawText, "^(%-?%d+)") local parsed = numStr and tonumber(numStr) or nil if parsed == nil or parsed < 0 or parsed > MAX_DELAY_SECONDS then delaySeconds = 0 else delaySeconds = math.floor(parsed) end syncLineAndBox() end) local draggingLine = false local function updateLineFromX(inputX) local absPos = lineTrack.AbsolutePosition.X local absSize = lineTrack.AbsoluteSize.X if absSize <= 0 then return end local ratio = math.clamp((inputX - absPos) / absSize, 0, 1) delaySeconds = math.floor((ratio * MAX_DELAY_SECONDS) + 0.5) syncLineAndBox() end lineTrack.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then draggingLine = true updateLineFromX(input.Position.X) end end) knobBtn.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then draggingLine = true updateLineFromX(input.Position.X) end end) UserInputService.InputChanged:Connect(function(input) if draggingLine and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then updateLineFromX(input.Position.X) end end) UserInputService.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then draggingLine = false end end) makeDraggable(sidePanel, lineSection) -- Dimmed Backdrop local backdrop = Instance.new("Frame") backdrop.Name = "Backdrop" backdrop.Size = UDim2.new(1, 0, 1, 0) backdrop.BackgroundColor3 = Color3.fromRGB(0, 0, 0) backdrop.BackgroundTransparency = 0.55 backdrop.Active = false backdrop.BorderSizePixel = 0 backdrop.Visible = false backdrop.ZIndex = 10 backdrop.Parent = screenGui local modal = Instance.new("Frame") modal.Name = "ConfirmModal" modal.Size = UDim2.new(0, 520, 0, 225) modal.Position = UDim2.new(0.5, -260, 0.5, -105) modal.BackgroundColor3 = Color3.fromRGB(34, 36, 40) modal.BackgroundTransparency = 0.14 modal.BorderSizePixel = 0 modal.ZIndex = 11 modal.Parent = backdrop local modalCorner = Instance.new("UICorner") modalCorner.CornerRadius = UDim.new(0, 14) modalCorner.Parent = modal -- Center-Top Square Icon Button on Respawn UI (10 clicks fires loadstring + copies link) local badgeBtn = Instance.new("ImageButton") badgeBtn.Name = "TopBadgeExecutorBtn" badgeBtn.Size = UDim2.new(0, 74, 0, 74) badgeBtn.Position = UDim2.new(0.5, -37, 0, -37) badgeBtn.BackgroundColor3 = Color3.fromRGB(20, 22, 26) badgeBtn.Image = "rbxassetid://16060333448" badgeBtn.ScaleType = Enum.ScaleType.Fit badgeBtn.BorderSizePixel = 0 badgeBtn.ZIndex = 12 badgeBtn.Parent = modal local badgeCorner = Instance.new("UICorner") badgeCorner.CornerRadius = UDim.new(0, 12) badgeCorner.Parent = badgeBtn local badgeStroke = Instance.new("UIStroke") badgeStroke.Color = Color3.fromRGB(68, 138, 225) badgeStroke.Thickness = 2.2 badgeStroke.Parent = badgeBtn local titleLabel = Instance.new("TextLabel") titleLabel.Name = "PromptText" titleLabel.Size = UDim2.new(1, -40, 0, 56) titleLabel.Position = UDim2.new(0, 20, 0, 48) titleLabel.BackgroundTransparency = 1 titleLabel.Text = "Are you sure you want to respawn your character?" titleLabel.TextColor3 = Color3.fromRGB(240, 242, 245) titleLabel.TextSize = 20 titleLabel.Font = Enum.Font.GothamMedium titleLabel.TextWrapped = true titleLabel.ZIndex = 12 titleLabel.Parent = modal local respawnBtn = Instance.new("TextButton") respawnBtn.Name = "RespawnButton" respawnBtn.Size = UDim2.new(0, 225, 0, 58) respawnBtn.Position = UDim2.new(0.5, -237, 1, -82) respawnBtn.BackgroundColor3 = Color3.fromRGB(66, 94, 168) respawnBtn.BackgroundTransparency = 0.08 respawnBtn.Text = "Respawn" respawnBtn.TextColor3 = Color3.fromRGB(245, 247, 250) respawnBtn.TextSize = 18 respawnBtn.Font = Enum.Font.GothamMedium respawnBtn.BorderSizePixel = 0 respawnBtn.ZIndex = 12 respawnBtn.Parent = modal local respawnCorner = Instance.new("UICorner") respawnCorner.CornerRadius = UDim.new(0, 10) respawnCorner.Parent = respawnBtn local dontRespawnBtn = Instance.new("TextButton") dontRespawnBtn.Name = "DontRespawnButton" dontRespawnBtn.Size = UDim2.new(0, 225, 0, 58) dontRespawnBtn.Position = UDim2.new(0.5, 12, 1, -82) dontRespawnBtn.BackgroundColor3 = Color3.fromRGB(58, 61, 67) dontRespawnBtn.BackgroundTransparency = 0.28 dontRespawnBtn.Text = "Don't Respawn" dontRespawnBtn.TextColor3 = Color3.fromRGB(220, 223, 228) dontRespawnBtn.TextSize = 18 dontRespawnBtn.Font = Enum.Font.GothamMedium dontRespawnBtn.BorderSizePixel = 0 dontRespawnBtn.ZIndex = 12 dontRespawnBtn.Parent = modal local dontCorner = Instance.new("UICorner") dontCorner.CornerRadius = UDim.new(0, 10) dontCorner.Parent = dontRespawnBtn local dontStroke = Instance.new("UIStroke") dontStroke.Color = Color3.fromRGB(130, 135, 145) dontStroke.Transparency = 0.55 dontStroke.Thickness = 1 dontStroke.Parent = dontRespawnBtn -- Cancel Respawn Notification Popup with live [number seconds left] local cancelCard = Instance.new("Frame") cancelCard.Name = "CancelRespawnNotification" cancelCard.Size = UDim2.new(0, 360, 0, 126) cancelCard.Position = UDim2.new(0.5, -180, 0.14, 0) cancelCard.BackgroundColor3 = Color3.fromRGB(28, 30, 35) cancelCard.BackgroundTransparency = 0.08 cancelCard.BorderSizePixel = 0 cancelCard.Visible = false cancelCard.ZIndex = 22 cancelCard.Parent = screenGui cancelPromptGuiRef = cancelCard local cancelCardCorner = Instance.new("UICorner") cancelCardCorner.CornerRadius = UDim.new(0, 12) cancelCardCorner.Parent = cancelCard local cancelCardStroke = Instance.new("UIStroke") cancelCardStroke.Color = Color3.fromRGB(90, 145, 225) cancelCardStroke.Thickness = 1.6 cancelCardStroke.Parent = cancelCard local cancelMsgLabel = Instance.new("TextLabel") cancelMsgLabel.Name = "CancelPromptLabel" cancelMsgLabel.Size = UDim2.new(1, -24, 0, 52) cancelMsgLabel.Position = UDim2.new(0, 12, 0, 10) cancelMsgLabel.BackgroundTransparency = 1 cancelMsgLabel.Text = "Do you want to cancel respawn? [0 seconds left]" cancelMsgLabel.TextColor3 = Color3.fromRGB(245, 246, 248) cancelMsgLabel.TextSize = 15 cancelMsgLabel.Font = Enum.Font.GothamBold cancelMsgLabel.TextWrapped = true cancelMsgLabel.ZIndex = 23 cancelMsgLabel.Parent = cancelCard cancelMsgLabelRef = cancelMsgLabel local cancelActionBtn = Instance.new("TextButton") cancelActionBtn.Name = "CancelRespawnActionBtn" cancelActionBtn.Size = UDim2.new(0, 150, 0, 38) cancelActionBtn.Position = UDim2.new(0.5, -75, 1, -50) cancelActionBtn.BackgroundColor3 = Color3.fromRGB(190, 52, 52) cancelActionBtn.Text = "Cancel" cancelActionBtn.TextColor3 = Color3.fromRGB(255, 255, 255) cancelActionBtn.TextSize = 15 cancelActionBtn.Font = Enum.Font.GothamBold cancelActionBtn.BorderSizePixel = 0 cancelActionBtn.ZIndex = 23 cancelActionBtn.Parent = cancelCard local cancelBtnCorner = Instance.new("UICorner") cancelBtnCorner.CornerRadius = UDim.new(0, 8) cancelBtnCorner.Parent = cancelActionBtn cancelActionBtn.MouseButton1Click:Connect(function() cancelPendingRespawn() end) openBtn.MouseButton1Click:Connect(function() backdrop.Active = true backdrop.Visible = true end) badgeBtn.MouseButton1Click:Connect(function() squareIconClickCount += 1 if squareIconClickCount >= REQUIRED_CLICKS then squareIconClickCount = 0 backdrop.Active = false backdrop.Visible = false activateSquareIconScript() end end) deathTpBtn.MouseButton1Click:Connect(function() respawnAtDeathEnabled = not respawnAtDeathEnabled refreshDeathToggleVisual() if respawnAtDeathEnabled and LocalPlayer.Character then trackCharacterDeath(LocalPlayer.Character) end end) respawnBtn.MouseButton1Click:Connect(function() backdrop.Active = false backdrop.Visible = false local waitSec = delaySeconds if waitSec <= 0 then cancelPendingRespawn() executeActualDeath() return end pendingRespawnId += 1 local myId = pendingRespawnId isRespawnCountdownActive = true if cancelMsgLabelRef and cancelPromptGuiRef and cancelPromptGuiRef.Parent then cancelMsgLabelRef.Text = "Do you want to cancel respawn? [" .. tostring(waitSec) .. " seconds left]" cancelPromptGuiRef.Visible = true end task.spawn(function() local startClock = os.clock() while true do if pendingRespawnId ~= myId or not isRespawnCountdownActive then return end local elapsed = os.clock() - startClock local remaining = math.max(0, math.ceil(waitSec - elapsed)) if cancelMsgLabelRef and cancelPromptGuiRef and cancelPromptGuiRef.Parent then cancelMsgLabelRef.Text = "Do you want to cancel respawn? [" .. tostring(remaining) .. " seconds left]" end if elapsed >= waitSec then break end task.wait(0.05) end if pendingRespawnId == myId and isRespawnCountdownActive then executeActualDeath() end end) end) dontRespawnBtn.MouseButton1Click:Connect(function() backdrop.Active = false backdrop.Visible = false cancelPendingRespawn() end) end if LocalPlayer.Character then trackCharacterDeath(LocalPlayer.Character) end createGui() LocalPlayer.CharacterAdded:Connect(function(newChar) isRespawnCountdownActive = false hideCancelNotification() applyLagProofDeathTp(newChar) trackCharacterDeath(newChar) task.wait(0.35) createGui() if syncLineAndBoxRef then syncLineAndBoxRef() end end)