ServerScriptService With tweening

Hello everyone! So today I was tweening 5 pumpkins. So in order to get all the pumpkins I used a table called Pump. I placed all of the pumpkins in there. Then I started tweening, and Yes I know there is a way easier way of doing this. I did everything that you have to do with TweenService and stuff. But basically I am using pumpkins and I’m trying to make it show a path for the player to show which pumpkin is bad or good. (killbrick or not) I am not sure what i did wrong because I did not get any errors. Here is my script. This script is in ServerScriptService btw.

-- Variables


local TweenSerivce = game:GetService("TweenService")
local Pump = {
	part1 = game.Workspace.Pumpkin1; -- Making a table for each part in workspace
	part2 = game.Workspace.Pumpkin2;
	part3 = game.Workspace.Pumpkin3;
	part4 = game.Workspace.Pumpkin4;
	part5 = game.Workspace.Pumpkin5
}
-- Making the Animation

local info = TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0)

local move1 = {Position = Vector3.new(208.31, -69.751, -405.28)}
local Move1 = {Position = Vector3.new(208.31, -70.301, -405.28)}

local pump1 = TweenSerivce:Create(Pump.part1,info,move1)
local Pump1 = TweenSerivce:Create(Pump.part1,info,Move1)

-- repeating process

local move2 = {Position = Vector3.new(201, -69.741, -396.95)}
local Move2 = {Position = Vector3.new(201, -70.301, -396.95)}

local pump2 = TweenSerivce:Create(Pump.part2,info,move2)
local Pump2 = TweenSerivce:Create(Pump.part2,info,Move2)

-- Reapeating again

local move3 = {Position = Vector3.new(208.31, -69.711, -387.81)}
local Move3 = {Position = Vector3.new(208.31, -70.301, -387.81)}

local pump3 = TweenSerivce:Create(Pump.part3,info,move3)
local Pump3 = TweenSerivce:Create(Pump.part3,info,Move3)

-- Again

local move4 = {Position = Vector3.new(215.07, -69.851, -377.43)}
local Move4 = {Position = Vector3.new(215.07, -70.301, -377.43)}

local pump4 = TweenSerivce:Create(Pump.part4,info,move4)
local Pump4 = TweenSerivce:Create(Pump.part4,info,Move4)

-- One last time...

local move5 = {Position = Vector3.new(208.31, -69.861, -366.86)}
local Move5 = {Position = Vector3.new(208.31, -70.301, -366.86)}

local pump5 = TweenSerivce:Create(Pump.part5,info,move5)
local Pump5 = TweenSerivce:Create(Pump.part5,info,Move5)

while true do
pump1:Play()
Pump1:Play()
wait(1)
pump2:Play()
Pump2:Play()
wait(1)
pump3:Play()
Pump3:Play()
wait(1)
pump4:Play()
Pump4:Play()
wait(1)
pump5:Play()
Pump5:Play()
wait(1)
end
1 Like

I am not sure if this is 100% the reason, but maybe it’s because you’re trying to tween one object with 2 tweens at the same time? That’s the only thing that I can see that may be causing it, unless the pumpkins are tweening, just not enough so you can’t see them.

Also, just a safety measure, maybe add some :WaitForChild()s in your Pump table as your code is going to execute as soon as the server starts (unless it’s wrapped in a function you didn’t include in your sample here).

Another thing, you don’t actually need these arguments as they’re set to the default value, you can leave them out and the tween should work as normal.

1 Like

Alright, I will try this out, Thank you for the feedback. And no There isn’t a function.

1 Like

HAHA, It was because I didn’t add waits between them lmaoo, smh… I apologize for this. I am pretty good with tweening and I usually don’t make these mistakes. Anyways, thanks for the help!

1 Like