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

Rotating gui doesn't rotate?

script.Parent.TextButton.MouseButton1Down:connect(function()
  script.Parent.Load.Rotation = (+24) 
end

You'd think this would be the way to rotate it. Can someone fix this?

1 comment

0

Please show errors.

2 answers

✓ Accepted answer
script.Parent.TextButton.MouseButton1Down:connect(function()
  script.Parent.Load.Rotation = script.Parent.Load.Rotation+24
end

1 comment

0

That wouldn't work either.

Well to begin with, there are many issues. Starting off with the "end". When using a connect(function() you must end the statement or function with "end)". Also, when you did script.Parent.Load.Rotation = (+24) there was another error. (+24) is not a valid statement either. You need to do

	script.Parent.Load.Rotation = script.Parent.Load.Rotation +24

Next to make sure the frame/image label doesn't go past 360, we need to do

	if script.Parent.Load.Rotation >= 360 then
		script.Parent.Load.Rotation = 0
	end

The final code is down below:

	script.Parent.TextButton.MouseButton1Down:connect(function()
		script.Parent.Load.Rotation = script.Parent.Load.Rotation +24
		if script.Parent.Load.Rotation >= 360 then
			script.Parent.Load.Rotation = 0
		end
	end)

Your welcome.

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