How can I make it run while I'm offline?

Hey everyone I have a system where u put a Mexo(character) in a machine and then it u should wait till the mutation can be claimed with the mexo anbd i just want that it also works while i’m offline but idk how to do it It’s simple I think I want the display mexo to be still there the time should be right and ye the time should be counted while I’m offline!


local script:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local Workspace = game:GetService("Workspace")
local RunService = game:GetService("RunService")

-- Client script to handle mutation notifications (put this in StarterPlayerScripts)

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local StarterGui = game:GetService("StarterGui")
local TweenService = game:GetService("TweenService")

local player = Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")

-- Create remote for mutation notifications
local mutationNotificationRemote = ReplicatedStorage:FindFirstChild("MutationNotification")
if not mutationNotificationRemote then
	mutationNotificationRemote = Instance.new("RemoteEvent")
	mutationNotificationRemote.Name = "MutationNotification"
	mutationNotificationRemote.Parent = ReplicatedStorage
end

-- Function to create mutation notification GUI
local function createMutationNotification(mutationType, success)
	local screenGui = Instance.new("ScreenGui")
	screenGui.Name = "MutationNotification"
	screenGui.ResetOnSpawn = false
	screenGui.Parent = playerGui

	local frame = Instance.new("Frame")
	frame.Name = "NotificationFrame"
	frame.Size = UDim2.new(0, 400, 0, 100)
	frame.Position = UDim2.new(0.5, -200, 0, -120) -- Start above screen
	frame.BackgroundColor3 = success and Color3.new(0.2, 0.8, 0.2) or Color3.new(0.8, 0.8, 0.2)
	frame.BorderSizePixel = 0
	frame.Parent = screenGui

	-- Add corner radius
	local corner = Instance.new("UICorner")
	corner.CornerRadius = UDim.new(0, 12)
	corner.Parent = frame

	-- Add stroke
	local stroke = Instance.new("UIStroke")
	stroke.Color = success and Color3.new(0, 1, 0) or Color3.new(1, 1, 0)
	stroke.Thickness = 3
	stroke.Parent = frame

	local textLabel = Instance.new("TextLabel")
	textLabel.Name = "MessageText"
	textLabel.Size = UDim2.new(1, 0, 1, 0)
	textLabel.Position = UDim2.new(0, 0, 0, 0)
	textLabel.BackgroundTransparency = 1
	textLabel.Font = Enum.Font.GothamBold
	textLabel.TextSize = 18
	textLabel.TextColor3 = Color3.new(1, 1, 1)
	textLabel.TextStrokeTransparency = 0.5
	textLabel.TextStrokeColor3 = Color3.new(0, 0, 0)
	textLabel.Parent = frame

	if success and mutationType then
		textLabel.Text = "🎉 You got a " .. mutationType .. " mutation! 🎉"
	elseif not success and mutationType then
		textLabel.Text = "❌ Failed to apply " .. mutationType .. " mutation"
	else
		textLabel.Text = "No mutation this time..."
	end

	-- Animate in
	local tweenIn = TweenService:Create(
		frame,
		TweenInfo.new(0.5, Enum.EasingStyle.Back, Enum.EasingDirection.Out),
		{Position = UDim2.new(0.5, -200, 0, 20)}
	)

	-- Animate out after 3 seconds
	local tweenOut = TweenService:Create(
		frame,
		TweenInfo.new(0.5, Enum.EasingStyle.Back, Enum.EasingDirection.In),
		{Position = UDim2.new(0.5, -200, 0, -120)}
	)

	tweenIn:Play()

	task.wait(3)
	tweenOut:Play()

	tweenOut.Completed:Connect(function()
		screenGui:Destroy()
	end)
end

-- Listen for mutation notifications from server
mutationNotificationRemote.OnClientEvent:Connect(function(mutationType, success)
	createMutationNotification(mutationType, success)
end)

-- ===== CONFIG DATA =====
local toolValues = {
	["Basic Mexo"] = 300,
	["Epic Mexo"] = 2000,
	["Godly Mexo"] = 20000,
	["Legendary Mexo"] = 5000,
	["Rare Mexo"] = 800,
	["Uncommon Mexo"] = 1500
}

local defaultHandleSizes = {
	["Basic Mexo"] = Vector3.new(5.215, 6, 2.072),
	["Rare Mexo"] = Vector3.new(2.225, 12.689, 6.33),
	["Uncommon Mexo"] = Vector3.new(5.722, 5.943, 4.034),
	["Epic Mexo"] = Vector3.new(8.679, 3.104, 11.4),
	["Legendary Mexo"] = Vector3.new(3.921, 6.779, 5.431),
	["Godly Mexo"] = Vector3.new(2.7, 9.306, 7.908),
}

local mexoScales = {
	["Basic Mexo"] = 0.759,
	["Rare Mexo"] = 0.408,
	["Uncommon Mexo"] = 0.568,
	["Epic Mexo"] = 0.274,
	["Legendary Mexo"] = 0.397,
	["Godly Mexo"] = 0.5,
}

local mexoModelNames = {
	["Basic Mexo"] = "Mexo",
	["Godly Mexo"] = "Mexo1",
	["Uncommon Mexo"] = "Mexo2",
	["Epic Mexo"] = "Mexo3",
	["Legendary Mexo"] = "Mexo4",
	["Rare Mexo"] = "Mexo5",
}

local fallbackDefaultHandleSize = Vector3.new(2.28, 1.5, 1.924)
local nerfFactor = 0.5

-- ===== REMOTES =====
local remote = ReplicatedStorage:WaitForChild("RequestMexo")
local claimMexoRemote = ReplicatedStorage:WaitForChild("ClaimMexo")

-- ===== TIMER =====
local acidPrompt = Workspace:WaitForChild("Mutate"):WaitForChild("Machine"):WaitForChild("Button"):WaitForChild("ProximityPrompt")
local timePart = Workspace:WaitForChild("Mutate"):WaitForChild("Time")
local textLabel = timePart.SurfaceGui.TextLabel
local totalTime = 5 -- seconds
local remainingTime = 0
local lastUpdate = 0
local timerActive = false
local originalPromptText = acidPrompt.ActionText
local promptState = "ready" -- "ready", "waiting", "claim"

local function formatTime(seconds)
	local minutes = math.floor(seconds / 60)
	local secs = seconds % 60
	return string.format("%02d:%02d", minutes, secs)
end

local function startTimer()
	remainingTime = totalTime
	timerActive = true
	textLabel.Text = formatTime(remainingTime)
	acidPrompt.ActionText = "Wait"
	promptState = "waiting"
end

RunService.Heartbeat:Connect(function(dt)
	if timerActive and remainingTime > 0 then
		lastUpdate += dt
		if lastUpdate >= 1 then
			remainingTime -= 1
			textLabel.Text = formatTime(math.max(0, remainingTime))
			lastUpdate = 0
		end
	elseif timerActive and remainingTime <= 0 then
		textLabel.Text = "00:00"
		timerActive = false
		acidPrompt.ActionText = "Claim"
		promptState = "claim"
	end
end)

-- ===== MODEL DISPLAY =====
local currentDisplayedModel
local rotationConnection

local function cleanupMexo()
	if currentDisplayedModel then
		currentDisplayedModel:Destroy()
		currentDisplayedModel = nil
	end
	if rotationConnection then
		rotationConnection:Disconnect()
		rotationConnection = nil
	end
end

local function displayMexo(mexoType, position)
	cleanupMexo()

	local mexosFolder = ReplicatedStorage:FindFirstChild("Mexos")
	if not mexosFolder then
		warn("Mexos folder missing")
		return
	end

	local template = mexosFolder:FindFirstChild(mexoModelNames[mexoType])
	if not template then
		warn("Mexo model missing:", mexoType)
		return
	end

	print("[Client] Creating display mexo - template found:", template.Name)

	-- Create the small scaled mexo for display only
	local model = template:Clone()
	model.Name = "SmallDisplayMexo"
	model:ScaleTo(mexoScales[mexoType] or 1)

	if model.PrimaryPart then
		model:SetPrimaryPartCFrame(CFrame.new(position))
	else
		local firstPart = model:FindFirstChildOfClass("BasePart")
		if firstPart then
			firstPart.CFrame = CFrame.new(position)
		end
	end

	for _, part in ipairs(model:GetDescendants()) do
		if part:IsA("BasePart") then
			part.LocalTransparencyModifier = 0
			part.CanCollide = false
		end
	end

	model.Parent = Workspace
	currentDisplayedModel = model
	print("[Client] Small mexo created and placed in Workspace")

	-- Animate the mexo
	local startTime = tick()
	local bobHeight, bobSpeed = 0.5, 1
	local rotationSpeed = math.rad(360) / 5

	rotationConnection = RunService.Heartbeat:Connect(function()
		if currentDisplayedModel and currentDisplayedModel.Parent then
			local elapsed = tick() - startTime
			local rotationY = elapsed * rotationSpeed
			local bobOffset = math.sin(elapsed * bobSpeed * math.pi * 2) * bobHeight
			local pos = position + Vector3.new(0, bobOffset, 0)

			if currentDisplayedModel.PrimaryPart then
				currentDisplayedModel:SetPrimaryPartCFrame(
					CFrame.new(pos) * CFrame.Angles(0, rotationY, 0)
				)
			end
		end
	end)
end

-- ===== HELPERS =====
local function getBaseTypeFromName(toolName: string)
	for baseName in pairs(toolValues) do
		if toolName == baseName or string.match(toolName, "^" .. baseName .. "%(") then
			return baseName
		end
	end
	return nil
end

-- ===== TOOL WORTH =====
local function calculateToolWorth(tool)
	local matchedType = getBaseTypeFromName(tool.Name)
	if not matchedType then
		return 0, nil
	end

	local baseValue = toolValues[matchedType]
	local handle = tool:FindFirstChild("Handle")
	local multiplier, neonMult, glowMult, goldMult, starMult = 1, 1, 1, 1, 1

	if handle and handle:IsA("BasePart") then
		local volume = handle.Size.X * handle.Size.Y * handle.Size.Z
		local defaultSize = defaultHandleSizes[matchedType] or fallbackDefaultHandleSize
		local defaultVolume = defaultSize.X * defaultSize.Y * defaultSize.Z
		multiplier = volume / defaultVolume

		if handle.Material == Enum.Material.Neon then
			neonMult = 10
		end
		if tool:GetAttribute("HasGlow") then
			glowMult = 10
		end
		if tool:GetAttribute("HasGold") then
			goldMult = 20
		end

		local function checkEmitter(name, mult)
			local emitter = handle:FindFirstChild(name)
			if emitter and emitter:IsA("ParticleEmitter") then
				starMult *= mult
			end
		end
		checkEmitter("Star", 25)
		checkEmitter("Dizzy", 25)
		checkEmitter("Heart", 30)
	end

	local adjustedMult = 1 + (multiplier - 1) * nerfFactor
	local worth = math.floor(baseValue * adjustedMult * neonMult * glowMult * goldMult * starMult + 0.5)
	return worth, matchedType
end

-- ===== PLAYER SETUP =====
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local inventory = player:FindFirstChild("Inventory") or player:WaitForChild("Inventory")

-- ===== REMOTE EVENTS =====
-- Listen for when mexo is ready to claim
claimMexoRemote.OnClientEvent:Connect(function()
	print("[Client] Server notified that mexo is ready to claim")
	-- Timer should already be at 0, but make sure
	timerActive = false
	remainingTime = 0
	textLabel.Text = "00:00"
	acidPrompt.ActionText = "Claim"
	promptState = "claim"
end)

-- ===== MAIN INTERACTION =====
acidPrompt.Triggered:Connect(function()
	-- Handle different prompt states
	if promptState == "waiting" then
		print("[Client] Still waiting, cannot interact")
		return
	elseif promptState == "claim" then
		print("[Client] Claiming mexo from server")
		cleanupMexo()
		acidPrompt.ActionText = originalPromptText
		promptState = "ready"
		textLabel.Text = "00:00"

		-- Tell server to add the mexo to inventory
		claimMexoRemote:FireServer()
		return
	end

	-- Normal mexo insertion logic
	local character = player.Character
	if not character then
		print("[Client] No character found")
		return
	end

	local tool = character:FindFirstChildOfClass("Tool") or inventory:FindFirstChildOfClass("Tool")
	if not tool then
		print("[Client] No tool found in character or inventory")
		return
	end

	print("[Client] Found tool:", tool.Name)
	local worth, mexoType = calculateToolWorth(tool)
	print("[Client] Worth:", worth, "Type:", mexoType)

	if worth >= 100000 and mexoType then
		print("[Client] Tool meets requirements, sending to server")

		local spawnPos = Vector3.new(-112.189, 4.494, 195.459)
		local scale = mexoScales[mexoType] or 1

		-- Send to server and start visual display
		remote:FireServer(tool, mexoType, spawnPos, scale)
		displayMexo(mexoType, spawnPos)
		startTimer()
	else
		print("[Client] Tool doesn't meet requirements. Worth:", worth, "Required: 1")
		cleanupMexo()
	end
end)








server script:




local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local Workspace = game:GetService("Workspace")
local ServerStorage = game:GetService("ServerStorage")

-- Get or create the remote events
local remote = ReplicatedStorage:FindFirstChild("RequestMexo")
if not remote then
	remote = Instance.new("RemoteEvent")
	remote.Name = "RequestMexo"
	remote.Parent = ReplicatedStorage
end

-- Create a remote for notifying client when mexo is ready to claim
local claimMexoRemote = ReplicatedStorage:FindFirstChild("ClaimMexo")
if not claimMexoRemote then
	claimMexoRemote = Instance.new("RemoteEvent")
	claimMexoRemote.Name = "ClaimMexo"
	claimMexoRemote.Parent = ReplicatedStorage
end

local rewardFolder = ServerStorage:WaitForChild("Saved")
local mutationsFolder = ServerStorage:WaitForChild("Mutations")
local inventoryEvent = ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("InventoryEvent")

-- Create mutation notification remote
local mutationNotificationRemote = ReplicatedStorage:FindFirstChild("MutationNotification")
if not mutationNotificationRemote then
	mutationNotificationRemote = Instance.new("RemoteEvent")
	mutationNotificationRemote.Name = "MutationNotification"
	mutationNotificationRemote.Parent = ReplicatedStorage
end

-- Store player mexo data temporarily
local playerMexoData = {}

-- Mutation chances (total should be 100%)
local mutationChances = {
	{name = "Chocolate", chance = 53},
	{name = "Honey", chance = 34},
	{name = "Ice", chance = 12},
	{name = "Rainbow", chance = 1}
}

-- Function to get random mutation based on chances
local function getRandomMutation()
	local random = math.random(1, 100)
	local cumulative = 0

	for _, mutation in ipairs(mutationChances) do
		cumulative = cumulative + mutation.chance
		if random <= cumulative then
			return mutation.name
		end
	end

	-- Fallback to Chocolate if something goes wrong
	return "Chocolate"
end

-- Function to get mexo base name from tool name
local function getMexoBaseName(mexoType)
	-- Convert "Basic Mexo" to "BasicMexo" for model naming
	return mexoType:gsub(" ", "")
end

local function addMutationToMexo(tool, mutationType, mexoType)
	print("=== MUTATION APPLICATION START ===")
	print("Tool Name:", tool.Name)
	print("Mutation Type:", mutationType)
	print("Mexo Type:", mexoType)
	-- Get the mutation part directly from the mutations folder
	local mutationPart = mutationsFolder:FindFirstChild(mutationType)
	if not mutationPart then
		warn("Mutation part not found:", mutationType)
		print("Available mutations in folder:")
		for _, child in ipairs(mutationsFolder:GetChildren()) do
			print("  -", child.Name, "(" .. child.ClassName .. ")")
		end
		return false
	end
	print("Found mutation part:", mutationPart.Name, "Class:", mutationPart.ClassName)
	-- Make sure it's a BasePart (Part, MeshPart, etc.)
	if not mutationPart:IsA("BasePart") then
		warn("Mutation is not a BasePart:", mutationPart.ClassName)
		return false
	end
	-- Get the tool's handle
	local handle = tool:FindFirstChild("Handle")
	if not handle or not handle:IsA("BasePart") then
		warn("Tool handle not found or not a BasePart")
		return false
	end
	print("Tool handle found:", handle.Name, "Size:", handle.Size)
	-- Clone the mutation part
	local clonedMutation = mutationPart:Clone()
	clonedMutation.Name = mutationType .. "Mutation"
	-- Set the mutation part properties
	clonedMutation.Size = handle.Size * 1.01 -- 1% bigger than handle
	clonedMutation.CFrame = handle.CFrame -- Same position as handle
	clonedMutation.CanCollide = false -- Prevent collision
	clonedMutation.Massless = true -- Prevent physics issues
	clonedMutation.Anchored = false -- Allow it to move with the tool
	-- Create a WeldConstraint to attach the mutation to the handle
	local weld = Instance.new("WeldConstraint")
	weld.Part0 = handle
	weld.Part1 = clonedMutation
	weld.Parent = handle
	-- Parent the mutation to the tool (not the handle, so it's visible in the tool structure)
	clonedMutation.Parent = tool
	print("Successfully added", mutationType, "mutation to tool")
	print("Mutation part size:", clonedMutation.Size)
	print("Mutation part position:", clonedMutation.Position)
	print("Weld created between handle and mutation")
	-- Create a BoolValue to track the mutation
	local mutationValue = Instance.new("BoolValue")
	mutationValue.Name = mutationType .. "MutationFlag"
	mutationValue.Value = true
	mutationValue.Parent = tool
	print("Created mutation flag:", mutationValue.Name)
	print("=== MUTATION APPLICATION END ===")
	return true
end

-- Helper function to get mexo data from tool
local function getMexoDataFromTool(tool)
	local handle = tool:FindFirstChild("Handle")
	if not handle then return nil end

	local mutations = {
		glow = tool:GetAttribute("HasGlow") or false,
		gold = tool:GetAttribute("HasGold") or false,
		neon = (handle.Material == Enum.Material.Neon),
		star = handle:FindFirstChild("Star") ~= nil,
		dizzy = handle:FindFirstChild("Dizzy") ~= nil,
		heart = handle:FindFirstChild("Heart") ~= nil
	}

	return {
		name = tool.Name,
		size = handle.Size,
		mutations = mutations,
		sizeOK = tool:GetAttribute("SizeOK") or false,
		hasAllMutations = tool:GetAttribute("HasAllMutations") or false,
	}
end

-- Helper function to create mutated mexo tool
local function createMutatedMexo(originalTool, mexoData)
	local newTool = originalTool:Clone()
	local handle = newTool:FindFirstChild("Handle")

	if handle then
		-- Apply original size
		handle.Size = mexoData.size

		-- Apply mutations
		if mexoData.mutations.neon then
			handle.Material = Enum.Material.Neon
		end

		-- Clear existing particle effects
		for _, child in ipairs(handle:GetChildren()) do
			if child:IsA("ParticleEmitter") or child.Name == "Star" or child.Name == "Dizzy" or child.Name == "Heart" then
				child:Destroy()
			end
		end

		-- Add particle effects based on mutations
		if mexoData.mutations.star then
			local starTemplate = rewardFolder:FindFirstChild("Star")
			if starTemplate and starTemplate:IsA("ParticleEmitter") then
				local starEmitter = starTemplate:Clone()
				starEmitter.EmissionDirection = Enum.NormalId.Front
				starEmitter.Parent = handle
				print("⭐ Added star effect to mutated mexo")
			end
		end

		if mexoData.mutations.heart then
			local heartTemplate = rewardFolder:FindFirstChild("Heart")
			if heartTemplate and heartTemplate:IsA("ParticleEmitter") then
				local heartEmitter = heartTemplate:Clone()
				heartEmitter.EmissionDirection = Enum.NormalId.Front
				heartEmitter.Parent = handle
				print("💖 Added heart effect to mutated mexo")
			end
		end

		if mexoData.mutations.dizzy then
			local dizzyTemplate = rewardFolder:FindFirstChild("Dizzy")
			if dizzyTemplate and dizzyTemplate:IsA("ParticleEmitter") then
				local dizzyEmitter = dizzyTemplate:Clone()
				dizzyEmitter.EmissionDirection = Enum.NormalId.Front
				dizzyEmitter.Parent = handle
				print("😵 Added dizzy effect to mutated mexo")
			end
		end

		-- Apply glow effect
		if mexoData.mutations.glow then
			local light = Instance.new("PointLight")
			light.Name = "WeatherGlow"
			light.Color = Color3.new(0.8, 0.9, 1)
			light.Brightness = 5
			light.Range = 15
			light.Parent = handle

			handle.Material = Enum.Material.Neon
			handle.Color = Color3.new(0.6, 0.95, 1)
			handle.UsePartColor = true
		end

		-- Apply gold effect
		if mexoData.mutations.gold then
			handle.Color = Color3.new(1, 0.84, 0)
			handle.Material = Enum.Material.Neon
			handle.UsePartColor = true

			local goldValue = Instance.new("BoolValue")
			goldValue.Name = "Gold"
			goldValue.Value = true
			goldValue.Parent = handle
		end
	end

	-- Set attributes
	newTool:SetAttribute("SizeOK", mexoData.sizeOK)
	newTool:SetAttribute("HasAllMutations", mexoData.hasAllMutations)
	newTool:SetAttribute("HasGlow", mexoData.mutations.glow)
	newTool:SetAttribute("HasGold", mexoData.mutations.gold)
	newTool:SetAttribute("HasStar", mexoData.mutations.star)
	newTool:SetAttribute("HasHeart", mexoData.mutations.heart)
	newTool:SetAttribute("HasDizzy", mexoData.mutations.dizzy)

	return newTool
end

-- Handle mexo requests
remote.OnServerEvent:Connect(function(player, tool, mexoToolType, position, scale)
	print("[Server] RemoteEvent fired by:", player.Name)
	print("[Server] Tool:", tool and tool.Name or "nil")
	print("[Server] MexoToolType:", mexoToolType)

	if not tool then
		warn("[Server] No tool provided")
		return
	end

	-- Store the mexo data for this player
	local mexoData = getMexoDataFromTool(tool)
	if mexoData then
		playerMexoData[player.UserId] = {
			originalTool = tool:Clone(),
			mexoData = mexoData,
			mexoType = mexoToolType
		}
		print("[Server] Stored mexo data for player:", player.Name)
	end

	-- Destroy the tool from character/backpack
	if tool and tool.Parent then
		tool:Destroy()
		print("[Server] Tool destroyed for everyone.")
	end

	-- Remove from custom inventory
	local inventory = player:FindFirstChild("Inventory")
	if inventory then
		local itemInInventory = inventory:FindFirstChild(tool.Name)
		if itemInInventory then
			itemInInventory:Destroy()
			print("[Server] Removed from custom Inventory:", tool.Name)
			-- Tell client UI to remove it
			inventoryEvent:FireClient(player, tool.Name, false)
		end
	end

	-- Start a timer for 5 seconds, then allow claiming
	task.wait(5)

	-- Notify client that mexo is ready to claim
	claimMexoRemote:FireClient(player)
	print("[Server] Notified client that mexo is ready to claim")
end)

-- Handle mexo claiming
claimMexoRemote.OnServerEvent:Connect(function(player)
	local userId = player.UserId
	local storedData = playerMexoData[userId]

	if not storedData then
		warn("[Server] No stored mexo data for player:", player.Name)
		return
	end

	print("[Server] Player claiming mexo:", player.Name)

	-- Create the mutated mexo
	local mutatedMexo = createMutatedMexo(storedData.originalTool, storedData.mexoData)

	-- ALWAYS get a mutation (removed the 53% check)
	local selectedMutation = getRandomMutation()
	print("[Server] Mutation rolled:", selectedMutation, "for", storedData.mexoType)

	-- Add the mutation to the mexo
	local success = addMutationToMexo(mutatedMexo, selectedMutation, storedData.mexoType)
	if success then
		-- Send success notification to client
		mutationNotificationRemote:FireClient(player, selectedMutation, true)
	else
		-- Send failure notification to client
		mutationNotificationRemote:FireClient(player, selectedMutation, false)
	end

	-- Add to player's inventory
	local inventory = player:FindFirstChild("Inventory")
	if not inventory then
		inventory = Instance.new("Folder")
		inventory.Name = "Inventory"
		inventory.Parent = player
	end

	-- Set the scale attribute for proper formatting
	local scale = 1
	if storedData.mexoData.size then
		-- Calculate scale based on size difference
		local defaultHandleSizes = {
			["Basic Mexo"] = Vector3.new(5.215, 6, 2.072),
			["Rare Mexo"] = Vector3.new(2.225, 12.689, 6.33),
			["Uncommon Mexo"] = Vector3.new(5.722, 5.943, 4.034),
			["Epic Mexo"] = Vector3.new(8.679, 3.104, 11.4),
			["Legendary Mexo"] = Vector3.new(3.921, 6.779, 5.431),
			["Godly Mexo"] = Vector3.new(2.7, 9.306, 7.908),
		}

		local defaultSize = defaultHandleSizes[storedData.mexoType] or Vector3.new(2.28, 1.5, 1.924)
		local actualSize = storedData.mexoData.size

		local scaleX = actualSize.X / defaultSize.X
		local scaleY = actualSize.Y / defaultSize.Y
		local scaleZ = actualSize.Z / defaultSize.Z
		scale = (scaleX + scaleY + scaleZ) / 3
	end

	-- Format scale to 2 decimal places
	local formattedScale = math.floor(scale * 100 + 0.5) / 100

	mutatedMexo:SetAttribute("Scale", scale)
	mutatedMexo.Name = storedData.mexoType .. "(" .. formattedScale .. ")"

	mutatedMexo.Parent = inventory

	-- Notify client UI
	inventoryEvent:FireClient(player, mutatedMexo.Name, true)

	-- Clean up stored data
	playerMexoData[userId] = nil

	print("[Server] Mutated mexo added to inventory:", mutatedMexo.Name)
	print("[Server] With", selectedMutation, "mutation applied")
end)

Hi there, if i understand it correctly you want to make it so that if a player leaves the “time” still runs, you can do that with datastores like:

local DSS = game:GetService("DataStoreService")
local PLRS = game:GetService("Players")
local Store = DSS:GetDataStore("LastSeenData")
PLRS.PlayerAdded:Connect(function(player)
	local userId = tostring(player.UserId)
	local success, lastSeenTime = pcall(function()
		return Store:GetAsync(userId)
	end)

	if success and lastSeenTime then
		local currentTime = os.time()
		local timePassed = currentTime - lastSeenTime
		print(player.Name .. " left " .. timePassed .. " sec ago")
	else
		print(player.Name .. " First join or error")
	end
end)
PLRS.PlayerRemoving:Connect(function(player)
	local userId = tostring(player.UserId)
	local currentTime = os.time()
	local success, err = pcall(function()
		Store:SetAsync(userId, currentTime)
	end)

	if not success then
		warn("Failed to save " .. player.Name .. ", " .. err)
	end
end)

Hope this helps!