So, i've tried to make a script where when a player joins, a ball appears. Everything is going out well except that the size doesn't randomize.
1 | game.Players.PlayerAdded:connect( function (player) |
2 | local ball = Instance.new( "Part" , workspace.Lobby) |
3 | ball.Shape = Enum.PartType.Ball |
4 | ball.Color = Color 3. new(math.random(), math.random(), math.random()) |
5 | ball.Size = Vector 3. new(math.random( 7 , 8 , 9 , 10 ), math.random( 6 , 7 , 8 , 9 , 10 ), math.random( 6 , 7 , 8 , 9 , 10 )) |
6 | ball.Position = Vector 3. new( 0.5 , 0.5 , - 0.5 ) |
7 | end ) |
what's the problem, the error says it has a wrong number of arrangements but i don't know what that means. How do i fix it?
I think the problem is that you have to many numbers for the size of the ball. Try using a local to define the random numbers like this:
local Y = math.random(1, 2, 3)
Then put:
Ball.Size = Y
Warning this is not the actual script I'm just pointing you in the right direction. Lemme know if this works