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

script.Parent.Position = script.Parent.Position - Vector3.new(0, 0.5, 0) error?

Asked by 4 years ago

i has a line of code in other lines of code. this line of code shows an error of 11:58:32.616 - Workspace.confetti.Part.Script:17: attempt to index field 'Parent' (a nil value) when i run the code. i am trying to make confetti slowly rain. i have been trying to fix this, its not working. can somebody help me? code:

script.Parent.Position = script.Parent.Position - Vector3.new(0, 0.5, 0)

1 answer

Log in to vote
0
Answered by
sheepposu 561 Moderation Voter
4 years ago

That's not how it works, this is how it works -

script.Parent.Position = Vector3.new(script.Parent.Position.X, script.Parent.Position.Y - 0.5, script.Parent.Position.Z)
0
works but does not work. it works then displays this in output: 12:15:32.352 - Workspace.confetti.Part.Script:17: attempt to index field 'Parent' (a nil value). (THIS IS WHEN THE CONFETTI HAS BEEN DESTROYED) codingMASTER398 52 — 4y
0
That's because it continuously went down till it was out of the world and therefore destroyed sheepposu 561 — 4y
0
it did'nt codingMASTER398 52 — 4y
0
oh, then idk sheepposu 561 — 4y
0
nvm codingMASTER398 52 — 4y
Ad

Answer this question