#why does this not work

1 messages · Page 1 of 1 (latest)

woven topaz
#

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.

carmine osprey
#

Is your VFXClone anchored?

graceful flint
#

the vfx part isn’t being positioned anywhere

woven topaz
woven topaz
carmine osprey
#

Weld you part or use an Attachment if that's not already the case

woven topaz
#

Yeah imma try that but scared for bugs, because on sever script it does not really work well

#

So imma try to make it update its CFrame every 30 Frames per second

woven topaz
carmine osprey
#

It shouldnt

#

Make your part CanCollide off and use Welds

#

I'm going to bed, just so you know, your current script has no problem but there is probably something that you have not setup properly or that you have not done