New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
1

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

Asked by 12 days ago
Edited 12 days 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". BashCaster 2537 — 12d
0
Thank you :) WolfHasQuack 3 — 12d

Answer this question