I need a scirpt that when I press a key it will enlarge my part but slowly ( Thanks you )
✓ ANSWER ACCEPTED
How to make a part bigger but grow up slowly to a specific level when I press a key ?
2 answers
✓ Accepted answer
Make sure it's in StarterGui and is a LocalScript!!
local part = workspace.Part -- Change it to your part name
local tweenService = game:GetService("TweenService")
local ti = TweenInfo.new(10) -- How much seconds it takes to grow completely
local uis = game:GetService("UserInputService")
local key = "E" -- Change it to whatever you want, just make sure its uppercase
local size = {}
size.Size = Vector3.new(10,10,10) -- Change the size
uis.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode[key] then
local tween = tweenService:Create(part,ti,size)
tween:Play()
end
end)
Insert this LocalScript into StarterGui:
local tweenService = game:GetService("TweenService")
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local part = workspace.Part
mouse.KeyDown:Connect(function(key)
if key == "r" then
local goal = {}
goal.Size = Vector3.new(100,100,100) -- size here
local tween = TweenInfo.new(7) --time (7)
local playTween = tweenService:Create(part, tween, goal)
playTween:Play()
end
end)
This will only work on your screen. Happy to help, b_mni.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
This is not a site to request scripts.