I’m trying to make exploded parts emit smoke and then after a few seconds have the smoke clear smoothly
I’m not sure what the problem is I have tried to fix it but nothing has worked
Here is the part of the script that I am having the problem with, it all works great until the line labeled “Smoke”
explode.Hit:Connect(function(part, distance)
if part and distance < 50 and part.Name == "Part" then
part:Destroy()
elseif part.Name == "Destroy" then
part:Destroy()
elseif part.Name == "Part" then
part.Material = "Pebble"
part.BrickColor = BrickColor.new(199)
--Smoke--
local smoke = game.ServerStorage.Smolder:Clone() smoke.Parent = part
delay(10, function()
for i = 50, 5, 1 do
part.Smolder.Size = NumberSequence.new(i, i)
wait(.5)
end
end)
end
end)
The ParticleEmitter properties only affect particles that are spawned after your new properties are set. Instead of setting the Size to a new constant number sequence each iteration, just set the size of the ParticleEmitter to start off at what you want the starting size to be, and then X seconds later plot a point at size = 0. This article might be able to help you out.
After a while of more research and trial and error I found It will work with a while loop, if anyone can tell me why it works with a while loop and not a for loop that would be greatly appreciated
a while loop works when a specific action is happening. a for loop works like a while loop but you assign a number to define how many times you need to run it. if you want to use an infinite loop, using while true do will work, all you need to do is add a wait() at the end of that while true do loop, or it will freeze the game and crash the server.