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

I need help moving a part?

Asked by 7 years ago
local NewPart = Instance.new("Part")
NewPart.Parent = game.Workspace
NewPart.Anchored = true
NewPart.Position = Vector3.new("-24, 35.5, -4") 
wait(3)
NewPart.Anchored = false
if NewPart.Position == Vector3.new("-24, 12.5, -4")  then
    NewPart.Anchored = true
end

this just inserts it onto the workspace, it does nothing else! i have no clue why!

0
What are is this script meant to do? User#5423 17 — 7y

1 answer

Log in to vote
0
Answered by
Pyrondon 2089 Game Jam Winner Moderation Voter Community Moderator
7 years ago

Vector3.new() takes three numbers, x, y and z, as arguments. You used three numbers, but you entered them as a string, when they should be as follows:

local NewPart = Instance.new("Part", workspace)
NewPart.Anchored = true
NewPart.Position = Vector3.new(-24, 35.5, -4) 
wait(3)
NewPart.Anchored = false
if NewPart.Position == Vector3.new(-24, 12.5, -4)  then
    NewPart.Anchored = true
end

That if statement probably isn't going to work out how you expect it to, though. Hope this helped.

Ad

Answer this question