Disabling Particles?

Hey,

the script is inside a part. If you touch the part it should remove the equipped tool and make the particles inside the part visible for 0.8 seconds. But somehow the particles are enabled by default, even if I disabled them in studio. Look at the first 2 lines in the script, is there anything wrong? Because it doesn’t work.

After you touched the part 1 time and the tool got removed then it works perfect. But why is it enabled by default?
Script:

local Particles = script.Parent.Particles.Smoke
wait(0.2)
Particles.Enabled = false

script.Parent.Touched:Connect(function(hit)
    print("moin")
    local Sound = game.SoundService.FirstTask
    local player = game.Players:GetPlayerFromCharacter(hit.Parent)
    if not player then return end
    local lemon = player.Backpack:FindFirstChild("Wheelbarrow") or player.Character:FindFirstChild("Wheelbarrow") 
    if lemon then
        local char = player.Character
        local equippedTool = char:FindFirstChildWhichIsA("Tool")
        if equippedTool then
            local ArrowEvent = game.ReplicatedStorage.ArrowEvent
            ArrowEvent:FireAllClients(script.Parent, false)
            lemon:Destroy()
            Particles.Enabled = true
            wait(0.8)
            Particles.Enabled = false
            
        end
    end
end)
2 Likes