Tween Not Working

My Tween Isn’t Working Can someone help me

script.Parent.MouseButton1Click:Connect(function
	
	

	game.Workspace.Fantasia:Play()
	
	local tweenService = game:GetService("TweenService")
	local part = game.Workspace.BlueExplosion.VFX
	local part1 = game.Workspace.BlueExplosion.VFX1
	local part2 = game.Workspace.BlueExplosion.VFX2
	local part3 = game.Workspace.BlueExplosion.VFX3
	local tweeningInformation = TweenInfo.new(

		50,
		Enum.EasingStyle.Elastic,
		Enum.EasingDirection.InOut,
		1,
		false

	)


	local part1Properties = {

		Size = Vector3.new(2000,2000,2000);
		Transparency = 0
	}


	local partProperties = {
		Size = Vector3.new(1995,1995,1995);
		Transparency = 0}
	local part2Properties = {
		Size = Vector3.new(1996,1996,1996);
		Transparency = 0}
	local part3Properties = {
		Size = Vector3.new(2007,2007,2007);
		Transparency = 0}
	local Tween = tweenService:Create(part,tweeningInformation,partProperties)
	local Tween1 = tweenService:Create(part1,tweeningInformation,part1Properties)
	local Tween2 = tweenService:Create(part2,tweeningInformation,part2Properties)
	local Tween3 = tweenService:Create(part3,tweeningInformation,part3Properties)


	Tween:Play()
	Tween1:Play()
	Tween2:Play()
	Tween3:Play()


	
	
	
	
end)```

You are missing a parameter in your TweenInfo. After your false, you need to enter a number (in seconds) of the delay you want in between each tween. Hope this helps!

Here is an example:

local tweenInfo = TweenInfo.new(
	8, -- How long should the tween take?
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.Out,
	10, -- Repeat times
	true, -- Should the tween repeat
	0 -- Tween delay
)

Add the parentheses

script.Parent.MouseButton1Click:Connect(function()
4 Likes

Thank you i feel stupid for not being able to see that hehe

local button = script.Parent

local ts = game:GetService("TweenService")

local tweenInfo = TweenInfo.new(50, Enum.EasingStyle.Elastic, Enum.EasingDirection.InOut, 1, false)

local vectors = {Vector3.new(2000,2000,2000), Vector3.new(1995,1995,1995), Vector3.new(1996,1996,1996), Vector3.new(2007,2007,2007)}
local tweens = {}
local fantasia = workspace:WaitForChild("Fantasia")
local explosions = workspace:WaitForChild("BlueExplosion"):GetChildren()

local fantasiaGoals = {Size = vectors[1], Transparency = 0}

local fantasiaTween = ts:Create(fantasia, tweenInfo, fantasiaGoals)

for i, explosion in ipairs(explosions) do
	local goals = {Size = vectors[i+1], Transparency = 0}
	local newTween = ts:Create(explosion, tweenInfo, goals)
	table.insert(tweens, newTween)
end

button.MouseButton1Click:Connect(function()
	fantasiaTween:Play()
	for _, tween in ipairs(tweens) do
		tween:Play()
	end
end)

Create as little as possible inside of callback functions connected to events as they are recreated each time the event is fired and the callback is subsequently executed. In the above I’ve moved all the tween creation outside of the callback and the callback simply handles the playing of each created tween.

I already found the solution
but thanks for trying

I’m aware, the fixes I made are still necessary for your game to run smoothly. Recreating the same constants and tweens and everything else inside the callback function connected to the event is incredibly strenuous, it’s much better to create, initialise and reference the required assets, instances etc. outside of the function and only perform necessary actions inside the function, as those actions are performed each time the event is fired, in this case whenever a Gui button is clicked.