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

Turning wheel around with script stuck at 90 orientation?

Asked by 4 years ago

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

local spinpower = math.random(20,50)
    repeat
        spinpower = spinpower - 1
        wait(0.2)
        script.Parent.spinner.Orientation = Vector3.new(script.Parent.spinner.Orientation.X + math.random(3,3),0,0)

        print(script.Parent.spinner.Orientation.X)
    until spinpower == 0 

but it aint work, just gets stuck at 90. so how to i turn things /:

1 answer

Log in to vote
2
Answered by 4 years ago
spin = 0
while spin <= 5 do
     wait(0.5)
     script.Parent.CFrame = CFrame.Angles(90,0,0)
     spin = spin + 1
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:

spin = 0
while spin <= 5 do
     wait(0.5)
     script.Parent.PrimaryPart.CFrame = CFrame.Angles(90,0,0)
     spin = spin + 1
end

If this worked please up vote and accept this answer.

All the best,

PrismaticFruits

Ad

Answer this question