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

Whats wrong with this Rotation script?

Could anyone help me fix my Rotation script? Or at least tell the what is wrong with it.

lever = script.Parent

lever.Touched:connect(function(hit)
while true do
	lever.Rotation = Vector3.new(-17.373, 0.59, 8.72) + 2
end
end)

lever.Touched:connect()

2 comments

0

Which coordinate(s) do you want to add the number 2 to?

0

17

1 answer

I suppose you want to add the 2 to the first coordinate (x). Use this:

lever = script.Parent
lever.Touched:connect(function(hit)
	while true do
		lever.Rotation = Vector3.new(-17-373, 0.59, 8.72) + Vector3.new(2, 0, 0)
	end
end)

You can't tell the script to add 2 to the Vector3 as it doesn't know which coordinate it should add to.

1 comment

1

There are a few additional problems with this. Unless a wait() is added, that while loop will crash the server. Also, this rotation is set to a fixed rotation, and never changes past that. You have to do level.Rotation = lever.Rotation + Vector3.new(2) --(valid btw) to fix that. Finally, that loop will never exit.

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