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

Rotating gui doesn't rotate?

Asked by 6 years ago
Edited 6 years ago
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?

0
Please show errors. gitrog 326 — 6y

2 answers

Log in to vote
0
Answered by 6 years ago
script.Parent.TextButton.MouseButton1Down:connect(function()
  script.Parent.Load.Rotation = script.Parent.Load.Rotation+24
end

0
That wouldn't work either. chima95 7 — 6y
Ad
Log in to vote
0
Answered by 6 years ago

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.

Answer this question