- 20:48:13.471 - ServerScriptService.Main.RaceModule.FunctionScript.PlaceChecker NIL:21: attempt to index a nil value*
local RaceStatistics = game.Workspace.Game.RaceStatistics
local Positions = RaceStatistics.Positions
Bleh = false
RaceStatistics.Racing.Changed:connect(function(yus)
if RaceStatistics.Racing.Value == true then
if Bleh == false then
Bleh = true
repeat
for i,k in pairs(game.Players:GetPlayers()) do
if k.TrackStatistics.Racing.Value == true then
if k.Character:findFirstChild("UpperTorso") then
local magnitude = (k.Character.UpperTorso.Position - game.Workspace.Game.TimingSystem:findFirstChild("S"..k.TrackStatistics.Section.Value + 1).Position).magnitude
Positions[k.Name].Value = magnitude
local MyPos = 8
for i,v in next, Positions:GetChildren() do
if v.name ~= "NotUsed" then
local temp = v.Name
if game.Players[temp].TrackStatistics.Laps.Value < k.TrackStatistics.Laps.Value then
MyPos = MyPos - 1
elseif (game.Players[temp].TrackStatistics.Laps.Value == k.TrackStatistics.Laps.Value) and
(game.Players[temp].TrackStatistics.Section.Value < k.TrackStatistics.Section.Value) then
MyPos = MyPos - 1
elseif (game.Players[temp].TrackStatistics.Laps.Value == k.TrackStatistics.Laps.Value) and
(game.Players[temp].TrackStatistics.Section.Value == k.TrackStatistics.Section.Value) and
(v.Value > Positions[k.Name].Value) then
MyPos = MyPos - 1
end
end
end
k.TrackStatistics.Position.Value = MyPos
end
end
end
wait()
until RaceStatistics.Racing.Value == false
Bleh = false
end
end
end)
Dont see why i would need to add the rest of the script

5 comments
Just add 1 more line, because this is where the error occured
ok
ill just add that section ;/
You're missing an "until" to end "repeat".
ill just add the whole script ;/ sorry