Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Particle disable and re-enable?

Asked by 4 years ago
Edited 4 years ago

So basically i have a projectile script that goes like this:

01script.Parent.OnServerEvent:Connect(function(plr)
02    local Slash = game.ReplicatedStorage.Slash13.YSlash3:Clone()
03    Slash.Parent = workspace
04    Slash.CanCollide = false
05    Slash.Anchored = false
06    Slash.CFrame = plr.Character.HumanoidRootPart.CFrame * CFrame.new(0,0,-5) * CFrame.fromEulerAnglesXYZ(1.8,0,0)
07    Slash.Touched:Connect(function(hit)
08        if hit.Parent:FindFirstChild("Humanoid") and hit.Parent.Name ~= plr.Name then
09            local Explosion = game.ReplicatedStorage.Slash13.Booom3:Clone()
10            Explosion.Parent = workspace
11            Explosion.CFrame = Slash.CFrame
12            Explosion.CanCollide = false
13            Explosion.Anchored = true
14            Slash:Destroy()
15            script.Parent.Parent.Parent.Parent.Explosion2:Play()
View all 30 lines...

i need the bit in green to change to a particle-like explosion!

ive tried:

1Explosion:WaitForChild("Attatchment"):WaitForChild:("StarSplash").Enabled = true
2wait(1)
3Explosion:WaitForChild("Attatchment"):WaitForChild:("StarSplash").Enabled = false
4wait(2)
5Explosion:Destroy()

ive also tried without the "WaitForChild" bit

basically i want more of a seamless explosion instead of a attachment leaking out particles then getting deleted

1 answer

Log in to vote
0
Answered by 4 years ago

Replace This:

1for i = 1,32 do
2    wait(.05)
3    Explosion.Size = Explosion.Size + Vector3.new(2,2,2)       
4    Explosion.Transparency = Explosion.Transparency + 0.05
5end
6Explosion:Destroy()

with this

1Explosion:WaitForChild("StarSplash").Enabled = true
2Explosion:WaitForChild("Stars").Enabled = true
3wait(.5)
4Explosion:WaitForChild("StarSplash").Enabled = false
5Explosion:WaitForChild("Stars").Enabled = false
6wait(2)
7Explosion:Destroy()

I've managed to fix the glitch, all i had to do is get the Booom3 part from replicated storage, delete the attatchment, make Booom3 the smallest [0.05,0.05,0.05] and put the particles in the booom3 insted of the attatchment

yes, i know i answered my own question, but i fixed it C:

Ad

Answer this question