Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Would you please help me find the error with this script?

Asked by 8 years ago

Okay, so the block gets the BodyPosition inside of it, but the position does not change. I think all of the naming at the top is correct, so I was wondering why it was not working.

b = script.Parent
o = script.Parent.Parent.path.one
t = script.Parent.Parent.path.two
th = script.Parent.Parent.path.three
f = script.Parent.Parent.path.four
fi = script.Parent.Parent.path.five
s = script.Parent.Parent.path.six
se = script.Parent.Parent.path.seven
e = script.Parent.Parent.path.eight
n = script.Parent.Parent.path.nine

x = 3

while true do
    bp = Instance.new("BodyPosition")
    bp.D = 1000
    bp.P = 1000
    bp.Parent = b
    bp.maxForce = Vector3.new(35000,35000,35000)
        wait(5)
    b.Anchored = false
    bp.position.X = o.Position.X
    bp.position.Y = o.Position.Y
    bp.position.Z = o.Position.Z
        wait(x)
    bp.position.X = t.Position.X
    bp.position.Y = t.Position.Y
    bp.position.Z = t.Position.Z
        wait(x)
    bp.position.X = th.Position.X
    bp.position.Y = th.Position.Y
    bp.position.Z = th.Position.Z
        wait(x)
    bp.position.X = f.Position.X
    bp.position.Y = f.Position.Y
    bp.position.Z = f.Position.Z
        wait(x)
    bp.position.X = fi.Position.X
    bp.position.Y = fi.Position.Y
    bp.position.Z = fi.Position.Z
        wait(x)
    bp.position.X = s.Position.X
    bp.position.Y = s.Position.Y
    bp.position.Z = s.Position.Z
        wait(x)
    bp.position.X = se.Position.X
    bp.position.Y = se.Position.Y
    bp.position.Z = se.Position.Z
        wait(x)
    bp.position.X = e.Position.X
    bp.position.Y = e.Position.Y
    bp.position.Z = e.Position.Z
        wait(x)
    bp.position.X  = n.Position.X
    bp.position.Y = n.Position.Y
    bp.position.Z = n.Position.Z

end

1 answer

Log in to vote
1
Answered by 8 years ago

You can not set just the x y and z values separate, you need to use a Vector3 Value or another object's position as shown below.

b = script.Parent
o = script.Parent.Parent.path.one
t = script.Parent.Parent.path.two
th = script.Parent.Parent.path.three
f = script.Parent.Parent.path.four
fi = script.Parent.Parent.path.five
s = script.Parent.Parent.path.six
se = script.Parent.Parent.path.seven
e = script.Parent.Parent.path.eight
n = script.Parent.Parent.path.nine

x = 3

while true do
    bp = Instance.new("BodyPosition")
    bp.D = 1000
    bp.P = 1000
    bp.Parent = b
    bp.maxForce = Vector3.new(35000,35000,35000)
        wait(5)
    b.Anchored = false
    bp.position = o.Position
        wait(x)
    bp.position= t.Position
        wait(x)
    bp.position = th.Position
        wait(x)
    bp.position = f.Position
        wait(x)
    bp.position = fi.Position
        wait(x)
    bp.position = s.Position
        wait(x)
    bp.position = se.Position
        wait(x)
    bp.position = e.Position
        wait(x)
    bp.position  = n.Position

end

0
Oh, okay. Thanks Lightdrago 95 — 8y
0
no ploblem. GuiHelperSince2014 70 — 8y
Ad

Answer this question