Debris:AddItem Dosen't work

I don’t know why but my :AddItem dosen’t work and it dosen’t give me any error

here is my script in a server script:

local Position = Projectile.Position
local Explosion1, Explosion2 = game.ReplicatedStorage.Assets.Prue_Assets.Explosion:Clone(), game.ReplicatedStorage.Assets.Prue_Assets.Floor:Clone()
Explosion1.Position = Position
Explosion2.Position = Position
Projectile:Destroy()
Debris:AddItem(Explosion1, 1.5)

It’s strange beceaus my other debris work

local Debris = game:GetService("Debris")
			
local Projectile = RE.Assets.Prue_Assets.First:Clone()
Projectile.Parent = game.Workspace.DebrisFolder
Projectile.Name = client.Name.." TeleExplosion"
Projectile.CFrame =	 CFrame.new((ClientHRP.CFrame * CFrame.new(0,2,-3)).p, MouseHit.p)
local BV = Instance.new("BodyVelocity", Projectile)
BV.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
BV.Velocity =  MouseHit.lookVector * Speed
Debris:AddItem(Projectile, 2.7)

Try game.Debris:AddItem() instead.

No it’s don’t work and it dosen’t give me any error

Did you define the debris service in the first script?

It’s the same script then it’s the same variable

Mm there may be another problem prior, try using prints** before the debris and before a few other things to see if something is halting it. You could also wrap it in a pcall to attempt an error to be thrown. You might have too many moving parts and need to wrap some of them either in a coroutine or a spawnfunction().

But the debris service doesn’t need to be defined if you use game.Debris:AddItem()

	if Hit then
			task.wait(.25)
			ActiveConnections[Bullet]:Disconnect()
			game.Debris:AddItem(Bullet, .25)
		end

Snippet from some of my code.

image
image

have you parented the explosions to the workspace? or have you just left them in replicated storage?

2 Likes

no why it’s imortant?I gonna try

Having explosions in replicated storage would do nothing.

1 Like