game.ReplicatedStorage.TriggerVFX2.OnClientEvent:Connect(function(vfxclone)
if not vfxclone or not vfxclone.Parent then return end
for _, emitter in pairs(vfxclone:GetDescendants()) do
if emitter:IsA("ParticleEmitter") then
local duration = emitter:GetAttribute("EmitDuration") or 0
-- emitter direct aanzetten
emitter.Enabled = true
-- emitter automatisch uitzetten na duration
task.delay(duration, function()
if emitter and emitter.Parent then
emitter.Enabled = false
end
end)
end
end
task.delay(5, function()
if vfxclone then
vfxclone:Destroy()
end
end)
end)
i am using a plugin, that makes a attribute called EmitDuration, this is in local, why does my script not work. I want it to emit for the duration.