Put this in a regular script inside ServerScriptService:
game:GetService("Players").PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local Height = Instance.new("NumberValue")
Height.Name = "Height"
Height.Parent = leaderstats
local char = player.CharacterAdded:Wait()
while task.wait() do
Height.Value = char:GetPivot().Position.Y
end
end)
Ok well you could change the script too. It’s recommended (for performance reasons) that you define the parent not only separate from Instance.new(), but in the last line.
local stuff = Instance.new("Part")
stuff.Name = "stuff"
stuff.Parent = workspace
Another thing: if you want your Y position to be more accurate, you can use char:GetPivot().Position which will return the position of the character’s model instead of just their HumanoidRootPart’s position.