How Would I Find The Position of a Model?
So I am trying to make a system that clones the model in a random position. Here is my script:
01 | local spawner = game.ReplicatedStorage.SpawnCage 1 |
02 | local cage = game.ServerStorage.Cage:Clone() |
03 | local cage 1 = cage:GetChildren() |
05 | if spawner.Value = = true then |
06 | cage.Parent = workspace |
07 | local position 1 = Vector 3. new( 0 , 0 , 0 ) |
08 | local position 2 = Vector 3. new( 10 , 0 , 0 ) |
09 | local position 3 = Vector 3. new( 20 , 0 , 0 ) |
10 | local position 4 = Vector 3. new( 30 , 0 , 0 ) |
11 | local chosenPos = { position 1 ,position 2 ,position 3 ,position 4 } |
12 | cage.Position = math.random( 1 ,#chosenPos) |
13 | elseif spawner.Value = = false then |
14 | cage.Parent = game.ServerStorage |
Here is the error in output:
18:23:29.929 - Position is not a valid member of Model
If someone could help me out here that would be very nice. Thanks in advance.