How Do I Get This To Respawn Blocks Correctly?
I have a script where you step on some "tnt" blocks and they get removed and recorded into DestroyedTNT (as a CFrame value for which ones were destroyed) and then they are later respawned and the values removed by the next round script. For some reason (I believe roblox updates might have messed with it because I swear it worked a few months ago) they start to respawn on each other (if you hit one, the next round you hit it again two pop out, then three, and so on).
03 | for _, v in pairs (game.Workspace:WaitForChild( "TNTS" ):GetChildren()) do |
04 | if _ % 200 = = 0 then wait( 0.1 ) end |
05 | if v.CFrame = = pos then |
13 | _G [ "NewRound" ] = function () |
14 | if game.Workspace:FindFirstChild( "Main" ) then |
15 | for k,v in pairs (game.Workspace.Main.DestroyedTNT:GetChildren()) do |
16 | if getTnt(v.Value) = = nil then |
17 | local tnt = Mtnt:Clone() |
18 | tnt.Parent = game.Workspace:WaitForChild( "TNTS" ) |
23 | game.Workspace.Main:remove() |