hi there, I had been able in creating a player Y position indicator that can display how high is the humanoid from the ground. which is beneficial in determining the success factor in the game I am creating. kind of like tower of hell.
here is the code that I created that shows the player's height from the ground in the leaderstat. and here is the screenshot of the said leaderstat
local function OnPlayerJoin(player)
repeat wait() until player.Character
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local Height = Instance.new("IntValue")
Height.Name = "Height"
Height.Parent = leaderstats
while wait() do Height.Value = (player.Character.HumanoidRootPart.Position.Y - 8) end
end
game.Players.PlayerAdded:Connect(OnPlayerJoin)
but right now I am trying to turn this number info into a graph like tower of hell did. any suggestion of how I can turn it in like a graph in Tower of Hell game did?
here is the TOH screenshot. graph

2 comments
Avoid using while loops. Try to use an event to start the function instead, as while loops cause severe lag when there are many players in the game.
what kind of event I should use to replace that while loops?