This script wasnt fully completed and didnt have 80% of the things before we added the clocked in and clocked out stuff, can we fix this

-- LocalScript inside a Tool

local tool = script.Parent
local player = game.Players.LocalPlayer
local runService = game:GetService("RunService")
local tweenService = game:GetService("TweenService")
local phoneGui = nil
local appScreens = {}
local isClockedIn = false
local clockInTime = 0

-- Utility: Add UIStroke
local function addStroke(ui, thickness, color, transparency)
	local stroke = Instance.new("UIStroke")
	stroke.Thickness = thickness
	stroke.Color = color
	stroke.Transparency = transparency or 0
	stroke.Parent = ui
end

-- Utility: Add UICorner for consistent rounded corners
local function addCorner(ui, radius)
	local corner = Instance.new("UICorner")
	corner.CornerRadius = radius or UDim.new(0, 24)
	corner.Parent = ui
end

-- Utility: Animate button (hover and click)
local function animateButton(button)
	local originalSize = button.Size
	local originalColor = button.BackgroundColor3
	local hoverTweenInfo = TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
	local clickTweenInfo = TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)

	button.MouseEnter:Connect(function()
		tweenService:Create(button, hoverTweenInfo, {Size = originalSize * 1.1}):Play()
	end)

	button.MouseLeave:Connect(function()
		tweenService:Create(button, hoverTweenInfo, {Size = originalSize}):Play()
	end)

	button.MouseButton1Down:Connect(function()
		tweenService:Create(button, clickTweenInfo, {BackgroundColor3 = Color3.new(originalColor.R + 0.2, originalColor.G + 0.2, originalColor.B + 0.2)}):Play()
	end)

	button.MouseButton1Up:Connect(function()
		tweenService:Create(button, clickTweenInfo, {BackgroundColor3 = originalColor}):Play()
	end)
end

-- Switch screen utility
local function switchToScreen(screenName)
	for name, screen in pairs(appScreens) do
		screen.Visible = (name == screenName)
	end

	local phoneFrame = phoneGui and phoneGui:FindFirstChild("PhoneFrame")
	if phoneFrame then
		local home = phoneFrame:FindFirstChild("HomeScreen")
		if home then
			home.Visible = (screenName == "Home")
		end
	end
end

-- App button creator (with icon and label)
local function createAppButton(appName, iconText, parent, position, onClick)
	local button = Instance.new("TextButton")
	button.Name = appName
	button.Size = UDim2.new(0, 70, 0, 70)
	button.Position = position
	button.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
	button.Text = ""
	button.AutoButtonColor = true
	button.Parent = parent
	addCorner(button, UDim.new(1, 0))
	addStroke(button, 1, Color3.fromRGB(80, 80, 80))

	local icon = Instance.new("TextLabel")
	icon.Size = UDim2.new(1, 0, 0, 40)
	icon.Position = UDim2.new(0, 0, 0, 5)
	icon.BackgroundTransparency = 1
	icon.Text = iconText
	icon.Font = Enum.Font.GothamBold
	icon.TextSize = 26
	icon.TextColor3 = Color3.new(1, 1, 1)
	icon.Parent = button

	local label = Instance.new("TextLabel")
	label.Size = UDim2.new(1, 0, 0, 20)
	label.Position = UDim2.new(0, 0, 1, -20)
	label.BackgroundTransparency = 1
	label.Text = appName
	label.Font = Enum.Font.Gotham
	label.TextSize = 14
	label.TextColor3 = Color3.new(1, 1, 1)
	label.Parent = button

	button.MouseButton1Click:Connect(onClick)
	return button
end

-- App screen creator (with back button)
local function createAppScreen(name, parentFrame)
	local frame = Instance.new("Frame")
	frame.Name = name
	frame.Size = UDim2.new(1, 0, 1, 0)
	frame.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
	frame.Visible = false
	frame.ZIndex = 3
	frame.Parent = parentFrame
	addCorner(frame)

	local back = Instance.new("TextButton")
	back.Name = "BackButton"
	back.Text = "← Back"
	back.Size = UDim2.new(0, 80, 0, 30)
	back.Position = UDim2.new(0, 10, 0, 10)
	back.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
	back.TextColor3 = Color3.new(1, 1, 1)
	back.Font = Enum.Font.GothamBold
	back.TextSize = 14
	back.Parent = frame
	addCorner(back, UDim.new(0, 8))

	back.MouseButton1Click:Connect(function()
		switchToScreen("Home")
	end)

	return frame
end

-- Phone GUI builder
local function createPhoneGui()
	local screenGui = Instance.new("ScreenGui")
	screenGui.Name = "PhoneGUI"
	screenGui.ResetOnSpawn = false
	screenGui.Parent = player:WaitForChild("PlayerGui")

	local phoneFrame = Instance.new("Frame")
	phoneFrame.Name = "PhoneFrame"
	phoneFrame.Size = UDim2.new(0, 320, 0, 520)
	phoneFrame.Position = UDim2.new(0.5, -160, 0.5, -260)
	phoneFrame.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
	phoneFrame.ClipsDescendants = true
	phoneFrame.Parent = screenGui
	addCorner(phoneFrame)
	addStroke(phoneFrame, 2, Color3.fromRGB(50, 50, 50))

	local wallpaper = Instance.new("ImageLabel")
	wallpaper.Name = "Wallpaper"
	wallpaper.Size = UDim2.new(1, 0, 1, 0)
	wallpaper.Image = "rbxassetid://3343074911" -- replace with your wallpaper ID
	wallpaper.BackgroundTransparency = 1
	wallpaper.ScaleType = Enum.ScaleType.Crop
	wallpaper.ZIndex = 0
	wallpaper.Parent = phoneFrame
	addCorner(wallpaper)

	local timeLabel = Instance.new("TextLabel")
	timeLabel.Name = "TimeLabel"
	timeLabel.Size = UDim2.new(1, 0, 0, 30)
	timeLabel.Position = UDim2.new(0, 0, 0, 5)
	timeLabel.BackgroundTransparency = 1
	timeLabel.TextColor3 = Color3.new(1, 1, 1)
	timeLabel.Font = Enum.Font.GothamBold
	timeLabel.TextSize = 20
	timeLabel.Text = "12:00 PM"
	timeLabel.ZIndex = 4
	timeLabel.Parent = phoneFrame

	-- Live time update
	runService:BindToRenderStep("UpdatePhoneTime", Enum.RenderPriority.First.Value, function()
		local now = os.date("*t")
		local hour = now.hour
		local minute = now.min
		local suffix = "AM"
		if hour >= 12 then
			suffix = "PM"
			if hour > 12 then hour = hour - 12 end
		elseif hour == 0 then
			hour = 12
		end
		timeLabel.Text = string.format("%02d:%02d %s", hour, minute, suffix)
	end)

	-- Home screen
	local homeScreen = Instance.new("Frame")
	homeScreen.Name = "HomeScreen"
	homeScreen.Size = UDim2.new(1, 0, 1, 0)
	homeScreen.BackgroundTransparency = 1
	homeScreen.ZIndex = 2
	homeScreen.Parent = phoneFrame

	-- Create 4 app buttons on home screen
	createAppButton("Bank", "🏦", homeScreen, UDim2.new(0.2, -35, 0.25, 0), function()
		switchToScreen("Bank")
	end)

	createAppButton("Jobs", "💼", homeScreen, UDim2.new(0.6, -35, 0.25, 0), function()
		switchToScreen("Jobs")
	end)

	createAppButton("Vehicles", "🚗", homeScreen, UDim2.new(0.2, -35, 0.5, 0), function()
		switchToScreen("Vehicles")
	end)

	createAppButton("Orders", "📦", homeScreen, UDim2.new(0.6, -35, 0.5, 0), function()
		switchToScreen("Orders")
	end)

	-- App Screens
	appScreens.Bank = createAppScreen("Bank", phoneFrame)
	appScreens.Jobs = createAppScreen("Jobs", phoneFrame)
	appScreens.Vehicles = createAppScreen("Vehicles", phoneFrame)
	appScreens.Orders = createAppScreen("Orders", phoneFrame)

	-- Bank App Content
	local bankLabel = Instance.new("TextLabel")
	bankLabel.Text = "Your Balance: $0"
	bankLabel.Size = UDim2.new(1, -20, 0, 40)
	bankLabel.Position = UDim2.new(0, 10, 0.3, 0)
	bankLabel.BackgroundTransparency = 1
	bankLabel.TextColor3 = Color3.new(1, 1, 1)
	bankLabel.Font = Enum.Font.Gotham
	bankLabel.TextSize = 20
	bankLabel.Parent = appScreens.Bank

	-- Jobs App: Clock In button
	local clockIn = Instance.new("TextButton")
	clockIn.Text = "Clock In"
	clockIn.Size = UDim2.new(0, 180, 0, 50)
	clockIn.Position = UDim2.new(0.5, -90, 0.4, 0)
	clockIn.BackgroundColor3 = Color3.fromRGB(0, 170, 255)
	clockIn.TextColor3 = Color3.new(1, 1, 1)
	clockIn.Font = Enum.Font.GothamBold
	clockIn.TextSize = 18
	clockIn.Parent = appScreens.Jobs
	addCorner(clockIn, UDim.new(0, 12))

	clockIn.MouseButton1Click:Connect(function()
		print("Clocked in!")
	end)

	-- Vehicles App: Spawn Vehicle button
	local spawnBtn = clockIn:Clone()
	spawnBtn.Text = "Spawn Vehicle"
	spawnBtn.Position = UDim2.new(0.5, -90, 0.4, 0)
	spawnBtn.Parent = appScreens.Vehicles
	spawnBtn.MouseButton1Click:Connect(function()
		print("Vehicle spawned!")
	end)

	-- Orders App: Label
	local ordersLabel = bankLabel:Clone()
	ordersLabel.Text = "No current orders."
	ordersLabel.Parent = appScreens.Orders

	return screenGui
end

-- Tool usage
tool.Equipped:Connect(function()
	if not phoneGui then
		phoneGui = createPhoneGui()
	end
	phoneGui.Enabled = true
	switchToScreen("Home")
end)

tool.Unequipped:Connect(function()
	if phoneGui then
		phoneGui.Enabled = false
	end
end)