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

Moving objects in script?

Asked by 9 years ago

I have tried this in every way I could think of and in WILL NOT move the object (btw, I don't need the model to be there, that was just another failed attempt)

while wait (5) do
    Model = Instance.new("Model", workspace)
    Ball = Instance.new("Part", Model)
    Ball.Shape = "Ball"
    Ball.BrickColor = BrickColor.new("Really black")
    pos = Vector3.new(script.Parent.Parent.Torso.Position - Vector3.new(0,10,0))
    Model:MoveTo(pos)
    Ball.Touched:connect(function(hit)
    local Boom = Instance.new("Explosion", Ball)
    Boom.Position = Vector3.new(Ball.Position)
    Boom.BlastRadius = 10
    Boom.BlastPressure = 10
    end)
end

1 answer

Log in to vote
0
Answered by
SurVur 86
9 years ago

On line 10, you are changing the Position. You are attempting something along the lines of : Vector3.new(Vector3.new())

The Position property already returns a Vector3, there is no need to create a new one and it will throw an error.

Ad

Answer this question