lp = game:GetService("Players").LocalPlayer;

ms = lp:GetMouse();
spawn(function()
	while true do
		local v1 = wait();
		if lp:FindFirstChild("PlayerGui") and lp.PlayerGui:FindFirstChild("UI") and lp.PlayerGui.UI:FindFirstChild("load") then
			if _G.loading then
				lp.PlayerGui.UI.load.real.Visible = true;
				lp.PlayerGui.UI.load.real.Rotation = lp.PlayerGui.UI.load.real.Rotation + v1 * 120;
				lp.PlayerGui.UI.load.real.BT.Rotation = math.cos(math.rad(lp.PlayerGui.UI.load.real.Rotation * 2)) * 20;
			else
				lp.PlayerGui.UI.load.real.Visible = false;
			end;
			if lp.PlayerGui.UI:FindFirstChild("cursor") then
				lp.PlayerGui.UI.cursor.Position = UDim2.new(0, ms.X, 0, ms.Y);
			end;
		end;	
	end;
end);
rs = game:GetService("ReplicatedFirst");
for v2, v3 in pairs(rs.vis:GetChildren()) do
	if v3:IsA("BasePart") then
		local v4 = Instance.new("Vector3Value");
		v4.Parent = v3;
		v4.Name = "OS";
		v4.Value = v3.Size;
	end;
end;
for v5, v6 in pairs(rs.hats:GetChildren()) do
	v6.Name = "hat" .. v6.id.Value;
end;
for v7, v8 in pairs(workspace:GetChildren()) do
	if v8:FindFirstChild("spawn") and v8:FindFirstChild("settings") then
		workspace.share.default.Value = v8;
		v8.Parent = rs.maps;
	end;
end;
resetting = false;
function _G.reset()
	resetting = true;
	wait();
	script.Parent.CharacterScript.Disabled = true;
	wait();
	script.Parent.CharacterScript:Destroy();
	game:GetService("Players").LocalPlayer.PlayerGui.UI:Destroy();
	for k, v in pairs(game:GetService("Players").LocalPlayer.PlayerGui:GetChildren()) do
		if v.Name == "UI" then
			v:Destroy()
		end
	end
	game.StarterGui.UI:Clone().Parent = game:GetService("Players").LocalPlayer.PlayerGui;
	game.StarterPlayer.StarterPlayerScripts.CharacterScript:Clone().Parent = script.Parent;
	wait();
	resetting = false;
end;