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? [Solved]

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

01	function myPart(myPosition)
02	    local part = Instance.new("Part")
03	    part.Anchored = true
04	    part.BrickColor = BrickColor.new("Black")
05	    part.Position = myPosition
06	    part.Parent = workspace
07	 
08	    return myPart
09	end
10	 
11	local myPartData = myPart(Vector3.new(2,7,1))
12	wait(3)
13	myPartData.Position = Vector3.new(2,7,2)

1 comment

0

Marked as non-descriptive as the OP does not provide output information (there should've been an error) nor posted any debugging results, nor does the OP specify where they think the problem may be.

1 answer

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

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