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

What's wrong with this GUI?

Asked by 10 years ago

I want this script to rotate but it doesn't seem to work

script.Parent:TweenPosition(UDim2.new(0.35,0,0.3,0), "Out", "Quad", 20) --Tween works
wait(10)
while true do
script.Parent.Rotation = +1
end

My friend said that you can't have a + so you need to do something else. This is in a local script so is there gonna be a slight problem with that?

1 answer

Log in to vote
1
Answered by
M39a9am3R 3210 Moderation Voter Community Moderator
10 years ago

Your friend is right, you do need something else. You need to have a rotation for the script to base off of.

So it would be script.Parent.Rotation = script.Parent.Rotation + 1

Warning your script will crash people on entry! Add a wait to the while true do loop.

Fixed code;

script.Parent:TweenPosition(UDim2.new(0.35,0,0.3,0), "Out", "Quad", 20) --Tween works
wait(10)
while true do
script.Parent.Rotation = script.Parent.Rotation + 1
wait()
end
Ad

Answer this question