Help for a 'HeightBar' GUI similar to the game Tower Of Hell [Video + script]

Hello, I am having difficulties to code the player’s progression in the GUI ‘HeightBar’ correled to the character progression inside the tower. The script seems to be almost functional but there is still a gap between the player on the GUI and the player in the tower. I don’t know how to fix this problem.

On the right side of the video you can see the progression of the Player GUI in the heightBar correled to the chacater progression inside the tower.

Video :

Script :

local distance = workspace.Tour.Depart.Toujours.Start.Position.Z - workspace.Tour.Fin.Toujours.FauxTriangle.Position.Z 
local function generateTemplate(plr2)	
	if plr2.Character and plr2.Character:FindFirstChild('HumanoidRootPart') then	
		local plrTemplate = PlayerGuiTemplate:FindFirstChild(plr2.Name)		
		if not plrTemplate then	
			plrTemplate = Template:Clone()
			plrTemplate.PlayersImage.Image = ''..plr2.UserId..'&width=420&height=420&format=png'
			plrTemplate.Name = plr2.Name
			plrTemplate.Visible = true
			plrTemplate.Parent = PlayerGuiTemplate
		local playerDistance = plr2.Character.HumanoidRootPart.Position.Z - workspace.Tour.Depart.Toujours.Start.Position.Z
		plrTemplate.Position =,0,1-(playerDistance/-distance),0)				

Here distance = The Start of the Tower Position.Z - the End of the Tower Position.Z