local Plugin = {
["PluginName"] = "betterrefresh",
["PluginDescription"] = "Plugin Made by 3itx",
["Commands"] = {
["betterrefresh"] = {
["ListName"] = "betterrefresh / br / r",
["Description"] = "Made by 3itx",
["Aliases"] = {"betterrefresh", "br", "r"},
["Function"] = function(args, speaker)
local Players = game:GetService("Players")
-- Variable to store the respawn position
local respawnPosition
-- Function to teleport the player back to the saved position
local function teleportToRespawnPosition()
local player = Players.LocalPlayer
if respawnPosition then
player.Character:WaitForChild("HumanoidRootPart").CFrame = respawnPosition end
end
Players.LocalPlayer.CharacterAdded:Connect(function(character)
-- Save the respawn position when the character is added
if respawnPosition then
teleportToRespawnPosition() end
end)
Players.LocalPlayer.CharacterRemoving:Connect(function(character)
-- Save the respawn position when the character is removed (before respawning)
if character and character:FindFirstChild("HumanoidRootPart") then
respawnPosition = character:WaitForChild("HumanoidRootPart").CFrame
end
end)
local humanoid = Players.LocalPlayer.Character:FindFirstChildOfClass("Humanoid")
if humanoid then
humanoid.Health = 0
end
end
}
}
}
return Plugin
Comments
how tf did you misspell yield 😭