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

How would i make this script shorter? [closed]

Asked by 9 years ago

How to make this shorter? I want it to keep going and never stop. I want the rotation to never stop going up, and the scripts parent is a text button.

if script.Disabled == false then

    script.Parent.Rotation = 1
    wait(0.01)
    script.Parent.Rotation = 2
    wait(0.01)
    script.Parent.Rotation = 3
    wait(0.01)
    script.Parent.Rotation = 4
    wait(0.01)
    script.Parent.Rotation = 5
    wait(0.01)
    script.Parent.Rotation = 6
    wait(0.01)
    script.Parent.Rotation = 7
    wait(0.01)
    script.Parent.Rotation = 8
    wait(0.01)
    script.Parent.Rotation = 9
    wait(0.01)
    script.Parent.Rotation = 10
    wait(0.01)
    script.Parent.Rotation = 11
    wait(0.01)
    script.Parent.Rotation = 12
    wait(0.01)
    script.Parent.Rotation = 13
    wait(0.01)
    script.Parent.Rotation = 14
    wait(0.01)
    script.Parent.Rotation = 15
    wait(0.01)
    script.Parent.Rotation = 16
    wait(0.01)
    script.Parent.Rotation = 17
    wait(0.01)
    script.Parent.Rotation = 18
    wait(0.01)
    script.Parent.Rotation = 19
    wait(0.01)
    script.Parent.Rotation = 20
    wait(0.01)
    script.Parent.Rotation = 21
    wait(0.01)
    script.Parent.Rotation = 22
    wait(0.01)
    script.Parent.Rotation = 23
    wait(0.01)
    script.Parent.Rotation = 24
    wait(0.01)
    script.Parent.Rotation = 25
    wait(0.01)
    script.Parent.Rotation = 26
    wait(0.01)
    script.Parent.Rotation = 27
    wait(0.01)
    script.Parent.Rotation = 28
    wait(0.01)
    script.Parent.Rotation = 29
    wait(0.01)
    script.Parent.Rotation = 30
    wait(0.01)
    script.Parent.Rotation = 31
    wait(0.01)
    script.Parent.Rotation = 32
    wait(0.01)
    script.Parent.Rotation = 33
    wait(0.01)
    script.Parent.Rotation = 34
    wait(0.01)
    script.Parent.Rotation = 35
    wait(0.01)
    script.Parent.Rotation = 36
    wait(0.01)
    script.Parent.Rotation = 37
    wait(0.01)
    script.Parent.Rotation = 38
    wait(0.01)
    script.Parent.Rotation = 39
    wait(0.01)
    script.Parent.Rotation = 40
    wait(0.01)
    script.Parent.Rotation = 41
    wait(0.01)
    script.Parent.Rotation = 42
    wait(0.01)
    script.Parent.Rotation = 43
    wait(0.01)
    script.Parent.Rotation = 44
    wait(0.01)
    script.Parent.Rotation = 45
    wait(0.01)
    script.Parent.Rotation = 46
    wait(0.01)
    script.Parent.Rotation = 47
    wait(0.01)
    script.Parent.Rotation = 48
    wait(0.01)
    script.Parent.Rotation = 49
    wait(0.01)
    script.Parent.Rotation = 50
    wait(0.01)
    script.Parent.Rotation = 51
    wait(0.01)
      end 

Locked by adark and BlueTaslem

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

1 answer

Log in to vote
2
Answered by
BlackJPI 2658 Snack Break Moderation Voter Community Moderator
9 years ago

This would shorten your script.

while true do
    for i = 1, 360, 1 do
        script.Parent.Rotation = Vector3.new(i, i, i) -- choose which axes to rotate
        wait()
    end
end

If you just want a spinning block, I would suggest you look into body objects (more specifically BodyAngularVelocity).

0
sorry I forgot to mention, that the script's parent is a textbutton My_Comment 95 — 9y
Ad