I am trying to make a big explosion's where 9 explosives in a 3x3 pattern drop down on the player. Imagine a tic tac toe board. There are 9 squares in a tic tac toe board. Now, imagine, in each square, there is an explosive. Now you have 9 explosives in a 3x3 pattern. What I am trying to do is take that 3x3 of explosives created in line 6-13 of cloning and positioning script, and put that above the players head. But my problem lies in line 18 of cloning and positioning (which does work). When I tried to teleport this 3x3 of explosives right above the players head (which is how I am going to make the big exposition) only the prime part on line 2 and the first bomb created was teleported (I can still see the other bombs at the center of the map that didn't get teleported). I then tried to solve this by messing around with my weld script which I provided below. But I couldn't find the problem.

Weld script (cloned from server storage and into each explosive, welds are created.)

local primaryPart = script.Parent.Parent.PrimePart
local newWeld = Instance.new("Weld", script.Parent)
newWeld.Part0 = script.Parent.ball
newWeld.Part1 = primaryPart

Cloning and positioning.

First we create a model. I didn't name it but lets just call it 'nuke'. Next its parent becomes the workspace. To be able to move the model. I made a primary part. Next, to create the bombs I made 2 for loops inside of each other. Every row that is created, there is also a column. Inside each, there is a new bomb that is created. It is currently anchored so I can observe the problem. Next, I clone and insert the weld script works perfectly fine and the welds are created. I am welding the ball part of the bomb to the primary part of the 'nuke'. Next I set the prime parts position to the bomb in the middle of the 3x3 nuke so it looks better when it teleports. then I change the CFrame of the primary part of the 'nuke' to players CFrame added by 10 in the y axis so the 'nuke' can fall down. Like I said, when I run it, only the prime part and the first bomb that was created gets teleported to the players CFrame.

local model = Instance.new("Model", game.Workspace)
	local primepart = Instance.new("Part", model)
	primepart.Name = "PrimePart"
	model.PrimaryPart = primepart
	for z = 1, 3, 1 do
		for x = 1, 3, 1  do
			local newBomb = game.ServerStorage.Bomb:Clone()
			newBomb.Name = "Bomb"..tostring(x)..tostring(z)
			newBomb.ball.Position = Vector3.new(x*5, -20, z*5)
			newBomb.Parent = model
			newBomb.ball.Anchored = true
			local newWeld = game.ServerStorage:FindFirstChild("Weld script (For bomb)"):Clone()
			newWeld.Parent = newBomb
		end
	end
	primepart.Position = model["Bomb22"].ball.Position
	model.PrimePart.CFrame = player.Character.HumanoidRootPart.CFrame + Vector3.new(0, 10, 0)

2 comments

0

Please provide a more detailed description of your problem. I am currently scratching my head about what your code even does. It will help if your post your full code and explanations on what everything does.

0

sure!