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

Why isn't my random wheel spinning?

Asked by 3 years ago
Edited 3 years ago

I'm making a random wheel that when the pointer (Model) is clicked, it spins the wheel for 5 seconds and lands on a choice. However when you click the pointer it doesn't spin the wheel. This is my script,


script.Parent.Parent.Model.ClickDetector.MouseClick:Connect(function() local Wheel = script.Parent local a = 0 repeat Wheel.Rotation = Vector3.new( a, 0, 0) wait(.01) a = a+3 until pigs == 10 wait (5) pigs ==1 )
0
Well much that I don't understand, and I assume this is not the entire script. But I'll just say that a ClickDetector needs to be in a Part, doesn't work in a Model Spjureeedd 385 — 3y
0
Well actually that is the entire script WhatsSamYT 9 — 3y
0
Okay well to start with then, you need to declare your variables, pigs doesn't exist. And you need an end after a function. And don't use repeat until loops, use for loops. You never create nor update pigs, so the loop is indefinite Spjureeedd 385 — 3y
0
And name your variables better, pigs is just weird Spjureeedd 385 — 3y

Answer this question