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

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?

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)

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. hiimgoodpack 2009 — 4y

Closed as Non-Descriptive by hiimgoodpack, NotFrindow, and User#5423

This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.

Why was this question closed?

1 answer

Log in to vote
1
Answered by 4 years ago

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

Ad