Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

My tween script doesn't work and it breaks when I run it? Could it be a problem with my script?

Im trying to make a tower defense game in which some cubes come from the black gate and go to the white gate, I set up a tween script to follow nodes which are the green orbs. heres my script:

local TweenService = game:GetService("TweenService")
local Parent = script.Parent
local count = 1
local TweenTable = {}

print("Wating!")
local Parts = game.Workspace:GetChildren()
for _,v in pairs(Parts) do
	print("checked:"..v.Name)
	if v.Name == "Node"..count then
		count = count + 1
		print(v.Name)
		local tweenInfo = TweenInfo.new(10)
		local goal = {}
		
		goal.Position = Vector3.new(v.Position.x, v.Position.y, v.Position.z)
		local tween = TweenService:Create(Parent, tweenInfo, goal)
		print("playing Tween!")
		tween:play()
	end
end

 

 

Heres my Screen shot of where the objects show up link

2 comments

0

can you be more specific from what you mean by your script breaks?

0

Look at the link and it doesn't go to the point, and it just stops short and is broken

1 answer

Ok so, you do not really need nodes, just set the paths as nodes

This discussion is preserved as it was. New answers, comments, and votes are closed.