I created this script to increase the size of a Part, but I wanted it to increase in size only to one side (and not two sides as it normally is) script:
Game.Players.PlayerAdded:Wait() While true do wait() script.Parent.Size = Script.Parent.Size + 1 end
my problem is that it increases, but for two sides and not one
The size property has three numbers, X Y Z. Here is an example:
script.Parent.Size = script.Parent.Size + Vector3.new(0,1,0)
Now, I don't have your game to know what direction is X, Y or Z, but you can change the numbers between the parenthesis to check what is the direction. I hope this helped!
I know what you're talking about. Here's the script:
Game.Players.PlayerAdded:Wait() While true do local StartingSize = script.Parent.Size -- Getting the size of the part before the changment of the size wait() script.Parent.Size = Script.Parent.Size + Vector3.new(0, 1, 0) -- Adding to the size, change it to whatever you want local ChangedSize = script.Parent.Size - PartSize -- Getting the difference of the starting size and the new size. script.Parent.Position = Vector3.new(ChangedSize / 2) -- Changing the position of the part so we have the impression that it's just changing size on one side end
So if you just want the part to expand on one side, you have to change the part's position. Also, if you wanna change the size of the part, use Vector3.new (line 6).
At line 8, I divided the difference of the size by 2, because in Roblox, normally, when you change the size of a part, the size will split up equally and add on both directions of the axis.
Example: if you expand a part's size by Vector3.new(0, 1, 0), if will expand on both sides of the Y-axis by 0.5.
Here's the script in clean version:
Game.Players.PlayerAdded:Wait() While true do local StartingSize = script.Parent.Size wait() script.Parent.Size = Script.Parent.Size + Vector3.new(0, 1, 0) local ChangedSize = script.Parent.Size - PartSize script.Parent.Position = Vector3.new(ChangedSize / 2) end
Hope this helped!
I'm sure it will work, try it.
Hey there, if you need to do it ONLY by a script, then i dont know. But if you need to do it with the scale tool, then i recommend you to use the F3X Building Tools, since it works for me.
Get them there:
https://www.roblox.com/library/144950355/Building-Tools-by-F3X-Plugin