Script not working

  1. What do you want to achieve? I want my ship to move players with it.

  2. What is the issue? The ship just goes and doesnt take players with it.

  3. What solutions have you tried so far? I tried using bodygyro and it doesnt wanna work here is the script.

local root = script.Parent
local root1 = script.Parent.BodyGyro.CFrame
local tweenservice = game:GetService("TweenService")
local Time = 450
local tweenInfo = TweenInfo.new(
	Time,
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.Out,
	0,
	false,
	0
)

local properties = {Position = Vector3.new(7.572, 77.884, 8594.644)}

local tween = tweenservice:Create(root,tweenInfo,properties)

tween:Play()

--- Here is where the body gyro script is.
local properties1 = {Position = CFrame.new(7.572, 77.884, 8594.644)}
local tween1 = tweenservice:Create(root1,tweenInfo,properties1)

tween1:Play()
1 Like

What is the error you are recieving?

image

This is my error do you know how to fix it?

Which line is the error on? Knowing which line is erroring would help me in solving this.

Try changing this to:

{Position + Vector3.new(7.572, 77.884, 8594.644)}

I tried this method but doesnt seem to work,

Line 20. and the variable thats making the error is line 2image

The variable is the CFrame itself, and you have to tween the root, not the CFrame of the root.

How about:

{CFrame = root1.CFrame + Vector3.new(0, 12, 0)}

How do I do that exactly? (30char)

Instead of tweening the BodyGyro’s CFrame directly, tween the BodyGyro, modifying the CFrame value, like so: (oops accidentally posted)

local root = script.Parent
local root1 = script.Parent.BodyGyro
local tweenservice = game:GetService("TweenService")
local Time = 450
local tweenInfo = TweenInfo.new(
	Time,
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.Out,
	0,
	false,
	0
)

local properties = {Position = Vector3.new(7.572, 77.884, 8594.644)}

local tween = tweenservice:Create(root,tweenInfo,properties)

tween:Play()

--Here is where the body gyro script is.
local properties1 = {}
properties1.CFrame = CFrame.new(7.572, 77.884, 8594.644)
local tween1 = tweenservice:Create(root1,tweenInfo,properties1)

tween1:Play()

Still doesnt seem to work that is very weird.

Nope… and just so you know it is a mesh part. if that helps

Also, are you trying to have the MeshPart look towards the location that the CFrame is set to, or move there?

1 Like

Do you have discord maybe I can call you and show you everything.

I don’t have access to calling on Discord at the moment, but it would be helpful to know what the gyro is intended to do.

Well someone told me that the ship would move players with it if I tween a bodygyro and I did but it doesnt seem to work.

Is it supposed to take over 5 minutes? The tween length is set to 450 seconds.

1 Like

I changed it too 100 just now (30char)

1 Like