What did i do wrong?!

My rocket script has a error.

if Configuration.UnattachStages.Value == true then
	
wait(30)
Stage1.Hole.Smoke.Enabled = false
Stage1.Hole.Sound:Stop()
Stage1.Hole.Flame.Enabled = false
wait(0.5)
Stage1.Attach.Decoupler:Play()
Stage1.Attach.Attach:Destroy()
wait(0.5)
Stage2.Hole.Sound:Play()
Stage2.Hole.Flame.Enabled = true
wait(60)
Stage2.Hole.Sound:Stop()
Stage2.Hole.Flame.Enabled = false
wait(0.5)
Stage2.Attach.Decoupler:Play()
Stage2.Attach.Attach:Destroy()
wait(0.5)
Stage3.Hole.Sound:Play()
Stage3.Hole.Flame.Enabled = true

if Configuration.FlyForever.Value == false then

wait(120)
Stage1.Hole.Sound:Stop()
Stage3.Hole.Flame.Enabled = false
Stage3.FlyPart.BodyVelocity:Destroy()
Stage3.FlyPart.BodyGyro:Destroy()
Stage3.Door:Destroy()
if Stage3.Hole.Position = 297.659, 286.845, -379.916 then
Stage3.Hole.Anchored = true
end
end
end

Expected then when parsing if statement, got =

You want this instead:

if Stage3.Hole.Position == 297.659, 286.845, -379.916 then

Small difference but when comparing values you use ==. Just the = is used for setting values, while == is used for comparing.

Same error, but with this symbol instead of =.
,

if Stage3.Hole.Position == 297.659, 286.845, -379.916 then

Which line? It should say which line the error occurred on.

Put your values into Vector3.new

So like this:
if Stage3.Hole.Position == Vector3.new(297.659, 286.845, -379.916) then

4 Likes