Hi there,
Looking for some assistance.
I was advised to create a function because the part’s I was creating had the same properties except for the color and size. I’m having a hard time trying to explain the issue, basically I want it each part to be labeled, part1, part2, part3 … etc. I hope the code could explain itself
local tweenService = game:GetService("TweenService")
local tweenInformation = TweenInfo.new(
5,
Enum.EasingStyle.Quint,
Enum.EasingDirection.InOut,
0,
false,
0
)
local Part = Instance.new("Part")
function createPart(color)
Part.Parent = game.Workspace
Part.Size = Vector3.new(1,1,1)
Part.Anchored = true
Part.CanCollide = false
Part.Material = Enum.Material.SmoothPlastic
Part.BrickColor = color
end
createPart(BrickColor.Black)
createPart(BrickColor.DarkGray()) -- I don't want it to overwrite the other createPart
local partInfo1 = {
Size = Vector3.new(2.5,0.3,2.5)
}
local partInfo2 = {
Size = Vector3.new(2.7,0.2,2.7);
}
local tween1 = tweenService:Create(createPart, tweenInformation, partInfo1)
local tween2 = tweenService:Create(createPart, tweenInformation, partInfo2)
wait(10)
tween1:Play()
tween2:Play()
Appreciate it,
Naucify