Your error is how your storing the positions
05 | local Coins = game.ServerStorage.Coins |
13 | Vector 3. new(- 154.1 , 1.1 , 86.9 ), |
14 | Vector 3. new(- 170.1 , 1.1 , 61.9 ), |
15 | Vector 3. new(- 132.1 , 1.1 , 63.9 ), |
16 | Vector 3. new(- 144.1 , 1.1 , 46.9 ), |
17 | Vector 3. new(- 172.1 , 1.1 , 36.9 ), |
18 | } -- [ [ A new line doesn't actually mean something, whitespaces are ignore in Lua |
22 | for i,v in pairs (Coins.FolderCoins:GetChildren() do |
24 | if Coins.Name = = CoinsName [ math.random( 1 , #CoinsNames) ] then |
25 | Coins.Position = Positions [ math.random( 1 , #CoinsNames) ] |
27 | x.Parent = game.Workspace |
Your problem was that the interpreter thought that you were storing a double type number, meaning a number with a decimal. While in reality you wanted the interpreter to return Vector3 values.
To sum it up
Lua thought this:
While you actually wanted
1 | Coints.Position = Vector 3. new( 0 , 0 , 0 ) |
Also, I noticed your code have some syntax errors plus other interpreted errors.
Take a look at your code:
05 | local Coins = game.ServerStorage.Coins |
22 | for i,v in pairs (Coins.FolderCoins:GetChildren() do |
24 | if Coins.Name = = CoinsName [ math.random( 1 , #CoinsNames) ] then |
25 | Coins.Position = Vector 3. new(Positions [ math.random( 1 , #CoinsNames) ] ) |
27 | x.Parent = game.Workspace |
And take a look at my:
05 | local Coins = game.ServerStorage.Coins |
13 | Vector 3. new(- 154.1 , 1.1 , 86.9 ), |
14 | Vector 3. new(- 170.1 , 1.1 , 61.9 ), |
15 | Vector 3. new(- 132.1 , 1.1 , 63.9 ), |
16 | Vector 3. new(- 144.1 , 1.1 , 46.9 ), |
17 | Vector 3. new(- 172.1 , 1.1 , 36.9 ), |
22 | for i,v in pairs (Coins.FolderCoins:GetChildren() do |
23 | if v.Name = = CoinsName [ math.random( 1 , #CoinsNames) ] then |
26 | coin.Parent = workspace |
27 | coin.Position = Vector 3. new(Positions [ math.random( 1 , #CoinsNames) ] ) |
If this help please vote up and as accepted, if it doesn't let me know and I'll help more. :)