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

Z cannot be assigned to?

so i want a part to stick to the other part but it says Z cannot be assigned to

while true do
	script.Parent.Position.Z = script.Parent.Parent.Part2.Position.Z - 1
	end

1 answer

✓ Accepted answer

You can't change the z value of a position, you would have to do this instead.

while true do
	local pos = script.Parent.Parent.Part2.Position

	script.Parent.Position = Vector3.new(pos.X, pos.Y, pos.Z - 1)
	wait() -- Don't forget the wait()
end

2 comments

0

thx

0

Happy to help!

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