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

how to make the part gradually bigger when I click a key ?

Asked by 4 years ago

I want to write a script when I press a key, the part will appear and enlarge to 1 specific size

0
Please help triccg123 9 — 4y

2 answers

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

You can insert a Local Script Into StarterPlayerScripts so when a key is pressed it can enlarge the part

function onKeyPress(inputObject, gameProcessedEvent)
    if not gameProcessedEvent then
    if inputObject.KeyCode == Enum.KeyCode.X  then -- Change X to the key you would like to press
        workspace.Test.Size = Vector3.new(10,10,10) -- Change 10,10,10 to the size you would like and Test to the name of your part
        end
    end
end
game:GetService("UserInputService").InputBegan:connect(onKeyPress)
0
thanks triccg123 9 — 4y
0
No problem! RazzyPlayz 497 — 4y
Ad
Log in to vote
0
Answered by
hallmk7 50
4 years ago

ok i think this might help you:-

local Part = game.Workspace.Part
local ClickDetector = Part.ClickDetector

ClickDetector.MouseClick:Connect(function()
Part.Size = Part.Size + vector3.new(1,1,1) -- change the length, breadth and height as per your needs 

end)

Hope this helps you!!

0
wait i didn't notice that it was a key however it would still help you!! hallmk7 50 — 4y
0
thanks triccg123 9 — 4y

Answer this question