please help me to fix it
wait() local TweenService = game:GetService("TweenService") local finish = workspace.ToolCams.Focus1.CFrame camera = workspace.CurrentCamera local timed = 0 local player = game.Players.LocalPlayer local char = nil finished = nil local Back = script.Parent.ScreenGui.Backward local For = script.Parent.ScreenGui.Forward local close = script.Parent.ScreenGui.Close local itemN = script.Parent.ScreenGui.ItemName local itemC = script.Parent.ScreenGui.ItemCost local Pur = script.Parent.ScreenGui.PurchaseButton local Debounce = false local tolv = false local tooly = nil repeat wait() until player.Character ~= nil --script.Parent.StatsGui.LocalScript.Disabled = false local function movie() finished = workspace.ToolCams:FindFirstChild("Focus1") timed = 1 itemN.Text = finished.Item.Value itemC.Text = "$"..finished.Cost.Value camera.CFrame = workspace.CameraPart.CFrame camera.CameraSubject = workspace.CameraPart game:GetService("RunService").RenderStepped:Wait() end local function search() local char = player.Character for i,v in pairs (char:GetChildren()) do if v:IsA("Tool") then tolv = 1 tooly = v else tolv = 0 tooly = v end end end local function bum() local back = player.Backpack for i,v in pairs (back:GetChildren()) do if v:IsA("Tool") then v:Destroy() end end end local function act() for i,v in pairs (player.Backpack:GetChildren()) do if v==nil then tolv = false else tolv = true end end end Pur.MouseButton1Down:connect(function() finished = workspace.ToolCams:FindFirstChild("Focus"..timed) local cash = player.leaderstats.Cash char = player.Character local Tools = char:FindFirstChild("tool") if cash.Value >= finished.Cost.Value then player.CurrentTool.tool:Destroy() cash.Value = cash.Value - finished.Cost.Value local item = game.ReplicatedStorage.Tools:FindFirstChild(finished.Item.Value):Clone() item.Parent = player.CurrentTool item.Name = "tool" end end) local function start() char = player.Character if Debounce == false then camera.CameraType = "Scriptable" Back.Visible = true For.Visible = true itemC.Visible = true itemN.Visible = true Pur.Visible = true close.Visible = true Debounce = true for i,v in pairs(script.Parent.ScreenGui:GetChildren()) do if v.Name == "BG" then v.Visible = true end end movie() end end For.MouseButton1Down:connect(function() timed = timed + 1 if timed == 4 then timed = 1 end local cameray = workspace.CameraPart finished = workspace.ToolCams:FindFirstChild("Focus"..timed) itemN.Text = finished.Item.Value itemC.Text = "$"..finished.Cost.Value workspace.CameraPart.PosTime.Value = timed local Tweeninfo = TweenInfo.new(1,Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0, false) local Goal = {CFrame = CFrame.new(finished.Position)} local tween = TweenService:Create(camera,Tweeninfo,Goal) tween:Play() print(timed) end) Back.MouseButton1Down:connect(function() timed = timed - 1 if timed == 0 then timed = 3 end local cameray = workspace.CameraPart finished = workspace.ToolCams:FindFirstChild("Focus"..timed) itemN.Text = finished.Item.Value itemC.Text = "$"..finished.Cost.Value workspace.CameraPart.PosTime.Value = timed local Tweeninfo = TweenInfo.new(1,Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0, false) local Goal = {CFrame = CFrame.new(finished.Position)} local tween = TweenService:Create(camera,Tweeninfo,Goal) tween:Play() print(timed) end) close.MouseButton1Down:connect(function() wait() Back.Visible = false For.Visible = false itemC.Visible = false itemN.Visible = false Pur.Visible = false close.Visible = false for i,v in pairs(script.Parent.ScreenGui:GetChildren()) do if v.Name == "BG" then v.Visible = false end end camera:Destroy() wait(0.1) camera = workspace.CurrentCamera camera.CameraType = Enum.CameraType.Custom game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid local char = player.Character local hum = char.HumanoidRootPart hum.CFrame = workspace.Respawn1.CFrame * CFrame.new(0,3,0) local v = player.CurrentTool.tool.Namey.Value player.CurrentTool.tool.Name = player.CurrentTool.tool.Namey.Value player.CurrentTool[v].Parent = player.Backpack Debounce = false end) local function Get() local y = nil local char = player.Character local back = player.Backpack for i,v in pairs (char:GetChildren()) do if v:IsA("Tool") then v.Parent = player.CurrentTool v.Name = "tool" end end if y == nil then for i,v in pairs (back:GetChildren()) do if v then v.Parent = player.CurrentTool v.Name = "tool" end end end end repeat wait() until player.Character.UpperTorso~=nil while true do local Debounce = true local center = workspace.Center2 local tool = game.Workspace.ToolTrigger if player.Character ~= nil then local char = player.Character local mag = (center.Position - char.UpperTorso.Position).magnitude if mag <= 6 then Get() Debounce = false start() Debounce = true end end wait() end