You haven't put character at CharacterAppearenceLoaded, Try this
01 | local serverStorage = game:GetService( "ServerStorage" ) |
02 | local DataStore = game:GetService( "DataStoreService" ):GetDataStore( "PlayerSave3" ) |
04 | game.Players.PlayerAdded:Connect( function (player) |
06 | local leaderstats = Instance.new( "Folder" ) |
07 | leaderstats.Name = "leaderstats" |
08 | leaderstats.Parent = player |
10 | local strength = Instance.new( "NumberValue" ) |
11 | strength.Name = "Strength" |
12 | strength.Parent = leaderstats |
14 | local rebirths = Instance.new( "IntValue" ) |
15 | rebirths.Name = "Rebirths" |
16 | rebirths.Parent = leaderstats |
18 | local dataFolder = Instance.new( "Folder" ) |
19 | dataFolder.Name = player.Name |
20 | dataFolder.Parent = serverStorage.RemoteData |
22 | local debounce = Instance.new( "BoolValue" ) |
23 | debounce.Name = "Debounce" |
24 | debounce.Parent = dataFolder |
26 | local strengthData, rebirthsData |
28 | local success,errormessage = pcall ( function () |
29 | strengthData = DataStore:GetAsync( "strength-" ..player.UserId) |
30 | rebirthsData = DataStore:GetAsync( "rebirths-" ..player.UserId) |
35 | strength.Value = strengthData |
36 | rebirths.Value = rebirthsData |
40 | player.CharacterAppearanceLoaded:Connect( function (character) |
41 | local humanoid = character.Humanoid |
42 | humanoid:WaitForChild( "BodyDepthScale" ).Value = . 5 + (strength / 250 ) |
43 | humanoid:WaitForChild( "BodyHeightScale" ).Value = . 5 + (strength.Value / 250 ) |
44 | humanoid:WaitForChild( "BodyWidthScale" ).Value = . 5 + (strength / 250 ) |
45 | humanoid:WaitForChild( "HeadScale" ).Value = . 5 + (strength / 250 ) |
46 | humanoid.Walkspeed = 16 * (strength.Value / 250 ) |
48 | strength:GetPropertyChangedSignal( "Value" ):Connect( function () |
49 | humanoid:WaitForChild( "BodyDepthScale" ).Value = . 5 + (strength / 250 ) |
50 | humanoid:WaitForChild( "BodyHeightScale" ).Value = . 5 + (strength.Value / 250 ) |
51 | humanoid:WaitForChild( "BodyWidthScale" ).Value = . 5 + (strength / 250 ) |
52 | humanoid:WaitForChild( "HeadScale" ).Value = . 5 + (strength / 250 ) |
53 | humanoid.Walkspeed = 16 * (strength.Value / 250 ) |
59 | game.Players.PlayerRemoving:Connect( function (player) |
60 | local success, errormessage = pcall ( function () |
61 | DataStore:SetAsync( "strength-" ..player.UserId,player.leaderstats.Strength.Value) |
62 | DataStore:SetAsync( "rebirths-" ..player.UserId,player.leaderstats.Rebirths.Value) |