Use a function to run the code and make some variables:
local part = script.Parent
local emitter = script.Parent.ParticleEmitter
function touch()
end
Now connect it to a tuched event:
local part = script.Parent
local emitter = script.Parent.ParticleEmitter
function touch()
end
part.Touched:Connect(touch)
Now disable the emitter
local part = script.Parent
local emitter = script.Parent.ParticleEmitter
function touch()
emitter.Enabled = false
end
part.Touched:Connect(touch)
And finally check if what touched it is a player.
local part = script.Parent
local emitter = script.Parent.ParticleEmitter
function touch(other)
local hum = other.Parent:FindFirstChild("Humanoid")
if hum then
emitter.Enabled = false
end
end
part.Touched:Connect(touch)