Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can i make so that my script stops to run when the size is max?

So i am currently making a game that you become bigger each time you click the weight, and i have no size limit because i dont know how to do that. If you could help me to mkae a max size script then thanks!

here is the script (Normal script) :

game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(Character) local Humanoid = Character:FindFirstChild("Humanoid") player.Character.Humanoid.BodyDepthScale.Value = player.leaderstats.strength.Value/10000 + 1 player.Character.Humanoid.BodyHeightScale.Value = player.leaderstats.strength.Value/10000 + 1 player.Character.Humanoid.BodyWidthScale.Value = player.leaderstats.strength.Value/10000 + 1 player.Character.Humanoid.HeadScale.Value = player.leaderstats.strength.Value/10000 + 1 player.leaderstats.strength.Changed:connect(function() player.Character.Humanoid.BodyDepthScale.Value = player.leaderstats.strength.Value/10000 + 1 player.Character.Humanoid.BodyHeightScale.Value = player.leaderstats.strength.Value/10000 + 1 player.Character.Humanoid.BodyWidthScale.Value = player.leaderstats.strength.Value/10000 + 1 player.Character.Humanoid.HeadScale.Value = player.leaderstats.strength.Value/10000 + 1 end) end) end)

1 answer

You can use math.min() and pass in the new size with the size limit. It should return the smallest number, which should be the number you inputted, otherwise the size limit.

2 comments

0

Where should it be located? I am pretty new scripter.

0

I would define it as a variable after finding the Humanoid, then set the values of the scale values to the variable.

This discussion is preserved as it was. New answers, comments, and votes are closed.