How would i go about a random number every time?
im making a bowling system and using math.random to decide where the pins fly
The problem is it picks 1 random number i need a random number for x, y, z and for the other 10 pins
workspace.ActiveBalls.ChildAdded:Connect(function(ball)
ball.Touched:Connect(function(toutcher)
if toutcher.Name == "Pin1" then
toutcher.CanCollide = false
toutcher.CanTouch = false
toutcher.Velocity = Vector3.new(math.random(100,200), math.random(100,200), math.random(100,200))
end
if toutcher.Name == "Pin2" then
toutcher.CanCollide = false
toutcher.CanTouch = false
toutcher.Velocity = Vector3.new(math.random(100,200), math.random(100,200), math.random(100,200))
end
if toutcher.Name == "Pin3" then
toutcher.CanCollide = false
toutcher.CanTouch = false
toutcher.Velocity = Vector3.new(math.random(100,200), math.random(100,200), math.random(100,200))
end
if toutcher.Name == "Pin4" then
toutcher.CanCollide = false
toutcher.CanTouch = false
toutcher.Velocity = Vector3.new(math.random(100,200), math.random(100,200), math.random(100,200))
end
if toutcher.Name == "Pin5" then
toutcher.CanCollide = false
toutcher.CanTouch = false
toutcher.Velocity = Vector3.new(math.random(100,200), math.random(100,200), math.random(100,200))
end
if toutcher.Name == "Pin6" then
toutcher.CanCollide = false
toutcher.CanTouch = false
toutcher.Velocity = Vector3.new(math.random(100,200), math.random(100,200), math.random(100,200))
end
if toutcher.Name == "Pin7" then
toutcher.CanCollide = false
toutcher.CanTouch = false
toutcher.Velocity = Vector3.new(math.random(100,200), math.random(100,200), math.random(100,200))
end
if toutcher.Name == "Pin8" then
toutcher.CanCollide = false
toutcher.CanTouch = false
toutcher.Velocity = Vector3.new(math.random(100,200), math.random(100,200), math.random(100,200))
end
if toutcher.Name == "Pin9" then
toutcher.CanCollide = false
toutcher.CanTouch = false
toutcher.Velocity = Vector3.new(math.random(100,200), math.random(100,200), math.random(100,200))
end
if toutcher.Name == "Pin10" then
toutcher.CanCollide = false
toutcher.CanTouch = false
toutcher.Velocity = Vector3.new(math.random(100,200), math.random(100,200), math.random(100,200))
end
end)
end)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.