Index nil with position

local DataStoreService = game:GetService("DataStoreService")

local PlrData = DataStoreService:GetDataStore("PlrData")

local function findStage(PlrStage)
	
	for _, Stage in pairs(workspace:WaitForChild("Stages"):GetChildren()) do
		
		if Stage:IsA("Model") and Stage:FindFirstChild(tostring(PlrStage)) then
			
			return Stage:FindFirstChild(tostring(PlrStage))
			
		end
		
	end
	
end

game.Players.PlayerAdded:Connect(function(plr)
	
	plr.CharacterAdded:Connect(function(Char)
		
		repeat task.wait() until Char and workspace:FindFirstChild("Stages")
		
		local Stage = findStage(plr.leaderstats.Stage.Value)
		
		Char.HumanoidRootPart.CFrame = CFrame.new(Stage.Position + Vector3.new(0,3,0))
		
	end)
	
	local leaderstats = Instance.new("Folder")
	leaderstats.Name = "leaderstats"
	leaderstats.Parent = plr
	
	local stage = Instance.new("IntValue")
	stage.Name = "Stage"
	stage.Parent = leaderstats
	
	local rebirths = Instance.new("IntValue")
	rebirths.Name = "Rebirths"
	rebirths.Parent = leaderstats
	
	local freeskips = Instance.new("IntValue")
	freeskips.Name = "FreeSkips"
	freeskips.Parent = plr
	
	local data
	
	local success, errorMessage = pcall(function()
		
		data = PlrData:GetAsync("Data-" .. plr.UserId)
		
	end)
	
	if success then
		
		if data then
			
			stage.Value = data.Stage
			
			rebirths.Value = data.Rebirths
			
			freeskips.Value = data.FreeSkips
			
			print(plr.Name .. " data successfully loaded.")
			
		else
			
			stage.Value = 1

			rebirths.Value = 0

			freeskips.Value = 1
			
			warn("Error whilst loading " .. plr.Name .. " data!")
			
		end
		
	end
	
end)

game.Players.PlayerRemoving:Connect(function(plr)
	
	local data = {
		Stage = plr.leaderstats.Stage.Value;
		Rebirths = plr.leaderstats.Rebirths.Value;
		FreeSkips = plr.FreeSkips.Value;
	}
	
	local success, errorMessage = pcall(function()

		PlrData:SetAsync("Data-" .. plr.UserId, data)

	end)
	
	if success then
		
		print(plr.Name .. " data successfully saved.")
		
	else
		
		warn("Error whilst saving " .. plr.Name .. " data!")
		
	end
	
end)

local RS = game:GetService("ReplicatedStorage")

local AddStageSkip = RS:WaitForChild("RemoteEvents").AddStageSkip

AddStageSkip.OnServerEvent:Connect(function(plr)
	
	plr.FreeSkips.Value += 1
	
end)

I’ve tried to wait for the stages folder to be created and wait for the char but nothing seems to work

It seems most likely that Stage is returning nil which is most likely to be caused by a string mismatch for the name.

“Attempted to index nil with Position”.
in your code, you’re only performing an index with the key “Position” in this line. so you’re indexing Stage with Position, which becomes Stage.Position. and variable Stage which is findStage(plr.leaderstats.Stage.Value) returned nil. that caused “Attempted to index nil with Position”.