-- 5'1 = 1.04, 5'2 = 1.08, 5'3 = 1.12, 5'4 = 1.16, 5'5 = 1.2, 5'6 = 1.24, 5'7 = 1.28, 5'8 = 1.30, 5'9 = 1.34
-- 6'0 = 1.38, 6'3 = 1.45, 6'5 = 1.5, 6'7 = 1.54, 6'9 = 1.6
wait(3)
local DataStore = game:GetService("DataStoreService")
local HeightStore = DataStore:GetDataStore("HeightStore")
local number = 1 or 2 or 3 or 4 or 5 or 6 or 7 or 8 or 9 or 10 or 11 or 12 or 13 or 14
game.Players.PlayerAdded:Connect(function(player)
local stats = Instance.new("Folder",player)
stats.Name = "leaderstats"
local Height = Instance.new("IntValue",stats)
Height.Name = "Height"
Height.Value = HeightStore:GetAsync(player.UserId) or number
print("Data Loaded.")
if number == 1 then player:FindFirstChild"Character".Humanoid.BodyHeightScale = 1.04
if number == 2 then player:FindFirstChild"Character".Humanoid.BodyHeightScale = 1.08
if number == 3 then player:FindFirstChild"Character".Humanoid.BodyHieghtScale = 1.12
if number == 4 then player:FindFirstChild"Character".Humanoid.BodyHeightScale = 1.16
if number == 5 then player:FindFirstChild"Character".Humanoid.BodyHeightScale = 1.2
if number == 6 then player:FindFirstChild"Character".Humanoid.BodyHeightScale = 1.24
if number == 6 then player:FindFirstChild"Character".Humanoid.BodyHeightScale = 1.28
if number == 8 then player:FindFirstChild"Character".Humanoid.BodyHeightScale = 1.3
if number == 9 then player:FindFirstChild"Character".Humanoid.BodyHeightScale = 1.34
if number == 10 then player:FindFirstChild"Character".Humanoid.BodyHeightScale = 1.38
if number == 11 then player:FindFirstChild"Character".Humanoid.BodyHeightScale = 1.45
if number == 12 then player:FindFirstChild"Character".Humanoid.BodyHeightScale = 1.5
if number == 13 then player:FindFirstChild"Character".Humanoid.BodyHeightScale = 1.54
if number == 14 then player:FindFirstChild"Character".Humanoid.BodyHeightScale = 1.6
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end)
game.Players.PlayerRemoving:Connect(function(player)
HeightStore:SetAsync(player.UserId,player.HeightStore.Height.Value)
print("Data Saved.")
end)
Output: leaderstats is not a valid member of player UserId not a valid member of player

1 comment
Quick: is it necessary to create a new instance on each playeradded?