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

Why isn't the property of my part changing after I called the function?

Asked by 4 years ago
Edited 4 years ago

I successfully got the function to work, but the position of the part will not change after waiting 3 seconds. Can you help me?

function myPart(myPosition)
    local part = Instance.new("Part")
    part.Anchored = true
    part.BrickColor = BrickColor.new("Black")
    part.Position = myPosition
    part.Parent = workspace

    return myPart
end

local myPartData = myPart(Vector3.new(2,7,1))
wait(3)
myPartData.Position = Vector3.new(2,7,2)
1
You're indexing the function, not the part itself. Change line 8 to "return part". DeceptiveCaster 3761 — 4y
0
Thank you :) WolfHasQuack 8 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

use myPartData.CFrame = CFrame.new(2,7,2)

Ad

Answer this question