Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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)

2 comments

1

You're indexing the function, not the part itself. Change line 8 to "return part".

0

Thank you :)

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.