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

Tweenservice bringing the parts to a wrong place. Whats wrong?

The parts are to go down. That never happens tho. lines go to the left. 2 blocks for hosts stands go up and one just stays put. Here is the script Trying to get this done by sunday morning.

local TweenService = game:GetService("TweenService")
local lightcontroller = game.ReplicatedStorage.Lights:Clone()
game.Players.PlayerAdded:connect(function(player)
	repeat wait() until player.Character
	player.Chatted:connect(function(msg)
		if player.TeamColor==game.Teams:findFirstChild("Service Manager").TeamColor or player.TeamColor==game.Teams:findFirstChild("Base Manager").TeamColor or player.TeamColor==game.Teams:findFirstChild("Developer").TeamColor or player.TeamColor==game.Teams:findFirstChild("Co-Owner").TeamColor or player.Name=="moo1210" then		
			if msg == ":lines" then 
				if workspace.Line1.InUse.Value==true then
					workspace.Line1.InUse.Value=false
					local Item = game.Workspace.Line1
					local goal = {}
					goal.Position = Vector3.new(125.76, 989.564, 140.04)
					local tweeninfo = TweenInfo.new(3,Enum.EasingStyle.Quad,Enum.EasingDirection.In)
					local tween = TweenService:Create(Item,tweeninfo,goal)
					tween:Play()
					wait(3)
					local Item = game.Workspace.Line3
					local goal = {}
					goal.Position = Vector3.new(125.76, 989.564, 140.04)
					local tweeninfo = TweenInfo.new(3,Enum.EasingStyle.Quad,Enum.EasingDirection.In)
					local tween = TweenService:Create(Item,tweeninfo,goal)
					tween:Play()
					wait(3)
					local Item = game.Workspace.Line2
					local goal = {}
					goal.Position = Vector3.new(125.76, 989.564, 140.04)
					local tweeninfo = TweenInfo.new(3,Enum.EasingStyle.Quad,Enum.EasingDirection.In)
					local tween = TweenService:Create(Item,tweeninfo,goal)
					tween:Play()
					wait(3)
				else
					workspace.Line1.InUse.Value=true
					local Item = game.Workspace.Line1
					local goal = {}
					goal.Position = Vector3.new(125.76, 994.014, 140.04)
					local tweeninfo = TweenInfo.new(3,Enum.EasingStyle.Quad,Enum.EasingDirection.In)
					local tween = TweenService:Create(Item,tweeninfo,goal)
					tween:Play()
					wait(3)
					local Item = game.Workspace.Line3
					local goal = {}
					goal.Position = Vector3.new(125.76, 994.014, 140.04)
					local tweeninfo = TweenInfo.new(3,Enum.EasingStyle.Quad,Enum.EasingDirection.In)
					local tween = TweenService:Create(Item,tweeninfo,goal)
					tween:Play()
					wait(3)
					local Item = game.Workspace.Line2
					local goal = {}
					goal.Position = Vector3.new(125.76, 994.014, 140.04)
					local tweeninfo = TweenInfo.new(3,Enum.EasingStyle.Quad,Enum.EasingDirection.In)
					local tween = TweenService:Create(Item,tweeninfo,goal)
					tween:Play()
					wait(3)
				end
		elseif msg == ":hostsstand" then
			if workspace.Stand1.Inuse==true then
				local Item = game.Workspace.Stand3
				local goal = {}
				goal.Position = Vector3.new(123.3, 992.904, 122.32)
				local tweeninfo = TweenInfo.new(3,Enum.EasingStyle.Quad,Enum.EasingDirection.In)
				local tween = TweenService:Create(Item,tweeninfo,goal)
				tween:Play()
				wait(3)
				local Item = game.Workspace.Stand2
				local goal = {}
				goal.Position = Vector3.new(131.23, 992.374, 122.32)
				local tweeninfo = TweenInfo.new(3,Enum.EasingStyle.Quad,Enum.EasingDirection.In)
				local tween = TweenService:Create(Item,tweeninfo,goal)
				tween:Play()
				wait(3)
				local Item = game.Workspace.Stand1
				local goal = {}
				goal.Position = Vector3.new(127.24, 991.585, 122.32)
				local tweeninfo = TweenInfo.new(3,Enum.EasingStyle.Quad,Enum.EasingDirection.In)
				local tween = TweenService:Create(Item,tweeninfo,goal)
				tween:Play()
			else
				local Item = game.Workspace.Stand3
				local goal = {}
				goal.Position = Vector3.new(123.3, 994.155, 122.32)
				local tweeninfo = TweenInfo.new(3,Enum.EasingStyle.Quad,Enum.EasingDirection.Out)
				local tween = TweenService:Create(Item,tweeninfo,goal)
				tween:Play()
				wait(3)
				local Item = game.Workspace.Stand2
				local goal = {}
				goal.Position = Vector3.new(131.23, 994.635, 122.32)
				local tweeninfo = TweenInfo.new(3,Enum.EasingStyle.Quad,Enum.EasingDirection.Out)
				local tween = TweenService:Create(Item,tweeninfo,goal)
				tween:Play()
				wait(3)
				local Item = game.Workspace.Stand1
				local goal = {}
				goal.Position = Vector3.new(127.24, 995.285, 122.32)
				local tweeninfo = TweenInfo.new(3,Enum.EasingStyle.Quad,Enum.EasingDirection.Out)
				local tween = TweenService:Create(Item,tweeninfo,goal)
				tween:Play()
			end
		elseif msg == ":lights" then
			lightcontroller.Parent = player.PlayerGui
			end
		end
	end)
end)

1 answer

Your variables are not different names because you have been editing the same variable the whole time and with TweenService, it just continues with the script without finishing the current command so it would be better if you renamed your variables into different things instead of making them all the same.

1 comment

0

But would this fix the script? Sorry for a really late reply. I didn't look at this post.

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