Enable Disable Particle

Hello, I Was Wondering How I Could Enable And Disable Particles From A Tool Located In Workspace

workspace.Player ( StarterPack), Here is The Script `local ha = 8165344945
local tool = script.Parent
repeat wait() until game.Players.LocalPlayer.Character
local LP = game.Players.LocalPlayer
local anim = Instance.new(“Animation”)
anim.AnimationId = “rbxassetid://”… ha
local PS = game.StarterPack.Sword.Handle.SmallerStar
local PS2 = game.StarterPack.Sword.Handle.LargerStar
PS.Enabled = false
PS2.Enabled = false
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function()
local backpack = player:WaitForChild(“Backpack”)
local cloneTool = game.ServerStorage.TestTool:Clone()
cloneTool.Parent = backpack
end)
end)
local dance = LP.Character.Humanoid:LoadAnimation(anim)
tool.Equipped:Connect(function()
dance:Play()
PS.Enabled = true
PS2.Enabled = true
wait(1)
local s = game.Players.LocalPlayer.Character:WaitForChild(“Sword”)
s.PS2.Enabled = false
s.PS.Enabled = false
end)

tool.Unequipped:Connect(function()
dance:stop()
end)

Just destroy the particle emitter.

didnt work sadly, now im dead inside

Your script is really unorganized. I can’t read it.

lemme send the main part

local dance = LP.Character.Humanoid:LoadAnimation(anim)
tool.Equipped:Connect(function()
dance:Play()
game.Players.LocalPlayer.Character:WaitForChild(“Sword”).Handle.LargeStar.Enabled = true
game.Players.LocalPlayer.Character:WaitForChild(“Sword”).Handle.SmallerStar.Enabled = true
wait(2)
game.Players.LocalPlayer.Character:WaitForChild(“Sword”).Handle.LargeStar:Destroy()
game.Players.LocalPlayer.Character:WaitForChild(“Sword”).Handle.SmallerStar:Destroy()
end)

local dance = LP.Character.Humanoid:LoadAnimation(anim)

tool.Equipped:Connect(function()
local largeStar = game.Players.LocalPlayer.Character:WaitForChild(“Sword”).Handle.LargeStar:Clone()
local smallerStar = game.Players.LocalPlayer.Character:WaitForChild(“Sword”).Handle.SmallerStar:Clone()

dance:Play()
wait(2)
largeStar:Destroy()
smallerStar:Destroy()
end)

does this work?

thanks imma try it :DDDDDDDDDDDDDDDDDDDD

When you copy a script to the forums you can either put three backticks (```) at the beginning of the script and at the end, or just highlight the script section and use the </> (Preformatted text) tool above the text box you type in to make the script more readable.

What do you mean by “a tool located in W”?

1 Like

I think my code might be incorrect.

1 Like

didnt work, i tried local script and normal script… the player is in workspace and it still doesnt work

Where is the particle located?

1 Like

inside the player,sword,handle

oki thanks, workspace thats what i meant

Try putting the particles in the replicated storage and

local dance = LP.Character.Humanoid:LoadAnimation(anim)

tool.Equipped:Connect(function()
local largeStar = game.ReplicatedStorage.LargeStar:Clone()
local smallerStar = game.ReplicatedStorage.SmallerStar:Clone()

largeStar.Parent = tool.Handle
smallerStar.Parent = tool.Handle
dance:Play()
wait(2)
largeStar:Destroy()
smallerStar:Destroy()
end)

alright i will try it, Thanks!

so i keep the particles in tthe sword or do i duplicate?

Put the particle in the replicated storage.

the particle’s isnt showing up in the sword tool after i putted them in replicatedstorage

did you put your sword variable in

largeStar.Parent = tool:WaitForChild("Handle")
smallerStar.Parent = tool:WaitForChild("Handle")
1 Like

Are you looking in the sword tool in the ‘Players’ folder, or your ‘Character’ model in the workspace?

1 Like