Nil but object exists?

I’m trying to make a marker that only appears for the player that imported the crate. I try to accomplish this by using a remote event, but when I fire the remote event from the server, the client says that the crate is nil?

ServerScript:

game.ReplicatedStorage.Events.Import.OnServerEvent:Connect(function(Player, Brick, Cost)
	if Player.leaderstats.Money.Value >= Cost then
		Player.leaderstats.Money.Value -= Cost
		game.ReplicatedStorage.Events.Import:FireClient(Player, "You have successfully purchased, '"..Brick.Name.."' for "..Cost.."$"..", 300 seconds until it arives.")
		task.wait(3) -- make this 300
		local Crate = game:GetService("ReplicatedStorage").Crate:Clone()
		Crate.Parent = workspace.CrateCache
		Crate:WaitForChild("Material").Value = Brick
		Crate:WaitForChild("Owner").Value = Player
		game.ReplicatedStorage.Events.ToggleCrateGui:FireClient(Player, Crate)
		game.ReplicatedStorage.Events.Import:FireClient(Player, "Your "..Brick.Name.." has arrived.")
	end
end)

LocalScript:

local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Root = Character:WaitForChild("HumanoidRootPart")

game.ReplicatedStorage.Events.ToggleCrateGui.OnClientEvent:Connect(function(Crate)
	task.wait(1)
	Crate:WaitForChild("BillboardGui").Enabled = true
	while Crate ~= nil do
		task.wait()
		local Magnitude = (Root.Position - Crate.Position).Magnitude
		Crate.BillboardGui.Distance.Text = Magnitude.." studs"
	end
end)

Its because you wait. If you wait, the game may change; whereas the game is effectively paused while a script is running.

repeat wait()

until Character:FindFirstChild("HumanoidRootPart")

local Root = Character:FindFirstChild("HumanoidRootPart")

or

if Character:FindFirstChild("HumanoidRootPart") then
      local Root = Character:FindFirstChild("HumanoidRootPart")
      --// code
end)

Either one, you just have to make sure not to wait in between when you confirm something is there and when you access it.