_G.AutoRebirt = false --Toggle Auto Rebirt
local TweenService = game:GetService("TweenService")
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local rootPart = character:WaitForChild("HumanoidRootPart")
local humanoid = character:WaitForChild("Humanoid")
local rebirthEvent = ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("AuraRunnerRebirth")
if _G.SimpleTPLoop then _G.SimpleTPLoop:Disconnect() _G.SimpleTPLoop = nil end
task.spawn(function()
while _G.AutoRebirt do
rebirthEvent:InvokeServer({})
task.wait(0.5)
end
end)
rootPart.Velocity, rootPart.RotVelocity = Vector3.new(0,0,0), Vector3.new(0,0,0)
humanoid:ChangeState(Enum.HumanoidStateType.Physics)
rootPart.Anchored = true
local tween = TweenService:Create(rootPart, TweenInfo.new(3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {CFrame = CFrame.new(-3493, 81, -19)})
tween:Play()
tween.Completed:Connect(function()
rootPart.Anchored = true
task.wait(3)
local targetWinPart, shortestDistance = nil, math.huge
for _, child in pairs(workspace:GetDescendants()) do
if child:IsA("BasePart") then
local c = child.Color
if math.floor(c.R*255) == 252 and math.floor(c.G*255) == 134 and math.floor(c.B*255) == 0 then
local distance = (rootPart.Position - child.Position).Magnitude
if distance < shortestDistance then
shortestDistance, targetWinPart = distance, child
end
end
end
end
rootPart.Anchored = false
rootPart.Velocity, rootPart.RotVelocity = Vector3.new(0,0,0), Vector3.new(0,0,0)
humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
task.wait(0.1)
if targetWinPart then
_G.SimpleTPLoop = RunService.Heartbeat:Connect(function()
local curChar = player.Character
local curRoot = curChar and curChar:FindFirstChild("HumanoidRootPart")
local curHum = curChar and curChar:FindFirstChildOfClass("Humanoid")
if curRoot and curHum and curHum.Health > 0 and targetWinPart then
curRoot.CFrame = targetWinPart.CFrame
curRoot.Velocity, curRoot.RotVelocity = Vector3.new(0,0,0), Vector3.new(0,0,0)
end
end)
end
end)
Comments
No comments yet
Be the first to share your thoughts!