hello! there is something I don't quite get about turning things around. so I'm making an arcade and want to make a "spin to win" thing. problem: can't turn it around. I tried
1 | local spinpower = math.random( 20 , 50 ) |
2 | repeat |
3 | spinpower = spinpower - 1 |
4 | wait( 0.2 ) |
5 | script.Parent.spinner.Orientation = Vector 3. new(script.Parent.spinner.Orientation.X + math.random( 3 , 3 ), 0 , 0 ) |
6 |
7 | print (script.Parent.spinner.Orientation.X) |
8 | until spinpower = = 0 |
but it aint work, just gets stuck at 90. so how to i turn things /:
1 | spin = 0 |
2 | while spin < = 5 do |
3 | wait( 0.5 ) |
4 | script.Parent.CFrame = CFrame.Angles( 90 , 0 , 0 ) |
5 | spin = spin + 1 |
6 | end |
Hopefully this script should turn the wheel 5 times at 90 degrees. You can change the numbers to whatever you need. This script will work if it is a single part. But if it is a model use this:
1 | spin = 0 |
2 | while spin < = 5 do |
3 | wait( 0.5 ) |
4 | script.Parent.PrimaryPart.CFrame = CFrame.Angles( 90 , 0 , 0 ) |
5 | spin = spin + 1 |
6 | end |
If this worked please up vote and accept this answer.
All the best,
PrismaticFruits