Landmine scripts dont work when model is duplicated

Hello, I’m a beginner in scripting and I am trying to make a landmine which uses custom particle emitters for the explosion effect. However when I duplicated the landmine only the original landmine’s particles worked

(Pink is duplicated and it’s particles don’t work, red is the original and works fine)
image

(I have 5 particle emitters and 1 script for each one )

workspace.Landmine.Mine.Touched:Connect(function(hit)
	game.Workspace.Landmine.Mine.Smoke1.Enabled = true
	wait(0.5)
	game.Workspace.Landmine.Mine.Smoke1.Enabled = false
end)

Here is how I made the model incase I did something wrong here or if anyone would like to give advice on how to improve the system
image

I think that something you might want to try is copying your landmine and putting the copy in replicatedstorage or somewhere. Disable the scripts inside that clone. Then, when you want to clone a landmine, clone that landmine inside of replicated storage and enable the scripts.

Particle emitters emit from the part they are inside. And instead of going through workspace to get the particle emitter I would do script.Parent.Smoke1

I tried out this by putting the script under the particle emitter and it didn’t work for me, below is the new script which didn’t work out

workspace.Landmine.Mine.Touched:Connect(function(hit)
	game.script.Parent.Smoke1.Enabled = true
	wait(0.5)
	game.script.Parent.Smoke1.Enabled = false
end)

This is unrelated to your issue, but try using Collections Service, it will make it much easier to edit in case you need to.

local collectionService = game:GetService("CollectionService")
local mines = collectionService:GetTagged("Mine") -- substitute with your own tag if you want

for i, v in ipairs(mines) do
    v.Mine.Touched:Connect(function(hit)
	    v.Mine.Smoke1.Enabled = true
	    wait(0.5)
	    v.Mine.Smoke1.Enabled = false
    end)
end

I think I might see the problem. Instead of using workspace.Landmine.Mine.Touched, change it to script.Parent.Touched. Also, change game.script.Parent.Smoke1.Enabled to just script.Parent.Smoke1.Enable. The script should look like this:

script.Parent.Touched:Connect(function(hit)
script.Parent.Smoke1.Enabled = true
wait(0.5)
script.Parent.Smoke1.Enabled = false
end)

This worked, Thanks everyone for the help!