I’m sorry if im not too detailed on my response.
The main problem is, is that whenever to access a frame inside of a gui, it is nil despite, being visibly there.
DistanceTracker.Update = function(player,t_)
local character = player.Character or player.CharacterAdded:Wait()
local root = character:FindFirstChild("HumanoidRootPart")
return RunService.Heartbeat:Connect(function()
if not DistanceTracker.Ratios[player] then return end
local playerFrame = UI:FindFirstChild("Scale"):FindFirstChild(player.Name)
local ratio = (root.Position - workspace.RaceTracks.Starter.RaceSpawn.Position).Magnitude/t_[3] --// distanceTraveled / entireDistanceToGain
playerFrame.Position = UDim2.fromScale(ratio,0.5)
DistanceTracker.Ratios[player] = ratio
end)
end
When I call this function, which is during a racing system/event in the game, I try to get the Scale frame to track every players distance from start to finish.
but if a player decided to reset, it would be inaccessible and many other errors are happening in other scripts when a player dies.
I’ve had this issue several times in the past and there aren’t any posts I can find talking about it.