Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make parts scale itself with a button? [closed]

Asked by 5 years ago

Hi, I want my part to scale itself by using a button.

I have tried many scripts but it doesn't work.

If you could do it for me that'd be great!

0
???? User#23365 30 — 5y
0
Basically I am saying that when you click a part in roblox how can it scale itself xMas_Ier 1 — 5y
0
also we dont accept people that requests scripts for other people to create for you User#23365 30 — 5y
View all comments (2 more)
0
make a attempt User#23365 30 — 5y
0
also just to give you an idea, you could listen for the MouseClick event of ClickDetector and then set the size of the part using the Vector3.new() constructor; which takes in x,y,z values if you didn't know User#23365 30 — 5y

Closed as Non-Descriptive by User#23365 and nilVector

This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.

Why was this question closed?

1 answer

Log in to vote
1
Answered by 5 years ago

First place two parts in workspace: One named 'Button' One named 'Part'

Then, inside 'Button' place a Click Detector, and inside the click detector place a Script

Inside that script, first set a variable for the part.

local part = game.Workspace.Part

Next connect MouseClick

script.Parent.ClickDetector.MouseClick:Connect(function ()
    --Scaling

    local originalSize = part.Size
    part.Size = originalSize + Vector3.new(10,0,0) 

end)

The Vector3.new(10,0,0) is for you to decide. Changing the (x, y, z) of the Vector3 to whatever you choose or however you want to scale it per click.

0
At the end of the day, it's best you show a failed attempt or some code for people to help you with.. Just asking for people to do it isn't the best route. That being said hope i was able to help GoodCallMrOlsen 70 — 5y
Ad