How can I select a random position inbetween two parts?
On line 12, my code isn't working. How can I make it so it picks a random position in between the start and end parts? (Part name "Start" and part named "End"
This is my error: Workspace.DrizzleRainCloud.RainGenerator:12: bad argument #2 (interval is empty)
06 | droplet = Instance.new( "Part" ) |
09 | droplet.BrickColor = BrickColor.new( "Toothpaste" ) or BrickColor.new( "Teal" ) |
10 | local start = game.Workspace.Start |
11 | local xend = game.Workspace.End |
12 | droplet.Position = Vector 3. new(math.random(start.Position.X, xend.Position.X)(math.random(start.Position.Y, xend.Position.Y)(math.random(start.Position.Z, xend.Position.Z)))) |
13 | droplet.Anchored = true |
14 | droplet.Size = Vector 3. new( 1 , 2 , 1 ) |
15 | droplet.Transparency = 0.8 |
16 | currentDroplet = currentDroplet + 1 |
17 | droplet.Name = "Droplet" ..currentDroplet |
19 | droplet.Anchored = false |
20 | droplet.Parent = script.Parent |
21 | droplet.CanCollide = false |
23 | if currentDroplet < = 50 then |
24 | droplet.Parent = script.Parent [ "Droplets1-50" ] |
26 | elseif currentDroplet > 50 and currentDroplet < = 100 then |
27 | droplet.Parent = script.Parent [ "Droplets51-100" ] |
29 | elseif currentDroplet > 100 and currentDroplet < = 150 then |
30 | droplet.Parent = script.Parent [ "Droplets101-150" ] |
32 | elseif currentDroplet > = 151 then |