I have a script that raises players upper torso size, but when it does, the player always dies and this always happens every second. Is there a way to fix the player not dying when his uppertorso size is raised? Here is my script:
game.Players.PlayerAdded:Connect(function(plr) plr.CharacterAdded:Connect(function(char) while wait(1) do local size = plr.leaderstats.Mass.Value/10 char.UpperTorso.Size = Vector3.new(size,size,size) end end) end)
I'm Assuming You Are Trying To Change The Entire Characters Size? If So Then Try This:
game.Players.PlayerAdded:Connect(function(plr) plr.CharacterAdded:Connect(function(char) while wait(1) do local size = plr.leaderstats.Mass.Value/10 game.Workspace:FindFirstChild(plr.Name).Humanoid:FindFirstChild('BodyHeightScale').Value = size game.Workspace:FindFirstChild(plr.Name).Humanoid:FindFirstChild('BodyDepthScale').Value = size game.Workspace:FindFirstChild(plr.Name).Humanoid:FindFirstChild('BodyWidthScale').Value = size game.Workspace:FindFirstChild(plr.Name).Humanoid:FindFirstChild('HeadScale').Value = size game.Workspace:FindFirstChild(plr.Name).Humanoid.HipHeight = size * 2 end end) end)
Try putting it in server script service, also if it doesn't work then try making sure that your leader stats are correct. (The Script Should Still Work If You Remove Either, The BodyHeightScale, The BodyDepthScale, The BodyWidthScale, Or The HeadScale) (But Just In Case You Should Still Try Without Removing Them First)