Broken script, help

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear! A timer

  2. What is the issue? Broken Script

  3. What solutions have you tried so far? None

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
The code:

local twee = game.TweenService
local a = twee:Create(script.Parent, TweenInfo.new(10, Enum.EasingStyle.Circular, Enum.EasingDirection.Out), {Position = Vector3.new(83, 21.5, 159.5)}):Play()
wait(10)
a:Play()

It plays the tween instantly instead of in 10 seconds!
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

2 Likes

There’s a play right at the end of the line. I suggest using variables to avoid long lines of code which caused this issue.

4 Likes

Also, you should probably use :GetService() in future

But what good will that do? It’s a waste of characters.

1 Like

Its better practice, simply. It also creates the service if it doesn’t exist although thats probably never going to be an issue you encounter since services are created almost immediately anyway. I agree that it is more efficient to type, but I guess its just not a normal thing :man_shrugging:

Im pretty sure you can seperate lines which will look like this

local a = twee:Create(
script.Parent,
TweenInfo.new(10, Enum.EasingStyle.Circular, Enum.EasingDirection.Out),
{Position = Vector3.new(83, 21.5, 159.5)}
):Play()

Also put the wait function before assigning the variable called “a” and remove the a:Play() since its already playing it because you added the :Play() function while assigning the variable

You should end up with this:

local twee = game.TweenService
wait(10)
local a = twee:Create(script.Parent, TweenInfo.new(10, Enum.EasingStyle.Circular, Enum.EasingDirection.Out), {Position = Vector3.new(83, 21.5, 159.5)}):Play()
local twee = game:GetService("TweenService")
local a = twee:Create(script.Parent, TweenInfo.new(10, Enum.EasingStyle.Circular, Enum.EasingDirection.Out), {Position = Vector3.new(83, 21.5, 159.5)})
wait(10)
a:Play()

If the service does not yet exist it will be created and the new service is returned.

Try: game:GetService('TweenService')

He already replied to that so yeah

Ohhhh. Yeh. Mb. Didn’t see that.

No its not. Some services can only be accessed with :GetService. Like datastores pathfinding and tweenservice

1 Like

local twee = game.TweenService

You need to replace this to:

local twee = game:GetService("TweenService")

Next, you need to make your tween info separate.

local tweenInfo = TweenInfo.new(10, Enum.EasingStyle.Circular, Enum.EasingDirection.Out)

Then make the tween:

twee:Create(script.Parent, tweenInfo, {Position = Vector3.new(83, 21.5, 159.5)})

Then afterward, play it.