Universal Script πŸ“Œ
574 Views
85 Executions

Reset Command

Universal Script πŸ“Œ
larkyqkwq
larkyqkwq100K executions
11 months ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No reports yet. Tried it? Be the first to say.

Also noticed:

Description

Brivwksc2

View Raw
--// Services
local Players = game:GetService("Players")
local Player = Players.LocalPlayer

--// Normalize text
local function clean(text)
	return string.lower(string.gsub(text, "%s+", ""))
end

--// Reset function
local function resetCharacter(keepPosition)
	local Character = Player.Character
	if not Character then return end

	local Humanoid = Character:FindFirstChildOfClass("Humanoid")
	local Root = Character:FindFirstChild("HumanoidRootPart")
	if not Humanoid or not Root then return end

	local savedCFrame
	if keepPosition then
		savedCFrame = Root.CFrame
	end

	Humanoid.Health = 0

	if keepPosition and savedCFrame then
		Player.CharacterAdded:Once(function(newChar)
			local newRoot = newChar:WaitForChild("HumanoidRootPart")
			newRoot.CFrame = savedCFrame
		end)
	end
end

--// Chat listener
Player.Chatted:Connect(function(msg)
	local text = clean(msg)

	-- SAME POSITION RESPAWN
	if text == "-re" then
		resetCharacter(true)


Comments

1
Log in to join the conversation. Login
crystals's profile picture
crystals11 months ago

replicatesignal(Player.ConnectDiedSignalBackend) task.wait(0.1) replicatesignal(Player.Kill)

1

More universal scripts

See all
Script hub
33.2k
298.5k
Bumped 3 hours ago
Script hub
23.7k
5.2k
Bumped 3 hours ago
Key System
Paid
High QualityΒ Offering
Universal Script πŸ“Œ
251
772
Bumped 3 hours ago
Universal Script πŸ“Œ
1.7k
31.0k
Bumped 3 hours ago
Script hub
4.1M
559.5k
Bumped 4 hours ago
Key System

Script hub

Hall of Fame #3

Verified script badgeOverflow 35 Supported Games

Script hub
5.5k
29.2k
Bumped 5 hours ago
Key System