alriight heres the issue: basically this code that i run firstly just does nothing and then spawns the particle n immedeately does the last tween and theen dissapears. please help.
elseif info == "lightparticle" then
for i = 0, math.random(countmin, countmax), 1 do
task.spawn(function()
local newparticol = Instance.new("Part")
newparticol.Size = Vector3.new(size)
newparticol.CanCollide = false
newparticol.CanQuery = false
newparticol.CanTouch = false
newparticol.Massless = true
newparticol.Material = Enum.Material.Neon
newparticol.Anchored = true
newparticol.Color = color
newparticol.Name = "particle"
newparticol.CollisionGroup = "particles"
newparticol.Transparency = 0
newparticol.Reflectance = .3
newparticol.TopSurface = Enum.SurfaceType.Smooth
newparticol.BottomSurface = Enum.SurfaceType.Smooth
newparticol.Position = objecttoparticle.Position + Vector3.new(math.random(-60, 60)/10, math.random(-10, 60)/10, math.random(-50, 50)/10)
newparticol.Parent = workspace
print("eee")
local ourwait = math.random(40, 60)/10
local tween = tweenserv:Create(newparticol, TweenInfo.new(ourwait, Enum.EasingStyle.Quint), {["Position"] = newparticol.Position + Vector3.new(0, math.random(30, 70)/10, 0), ["Color"] = Color3.fromRGB(color.R*255+15, color.G*255+15, color.B*255+15)})
tween:Play()
tween.Completed:Connect(function()
tweenserv:Create(newparticol, TweenInfo.new(.4, Enum.EasingStyle.Circular), {["Transparency"] = 1, ["Size"] = Vector3.new(.15, 1.5, .15)}):Play()
task.wait(.4)
newparticol:Destroy()
end)
end)
end
end
the first prints work immedeately, without a delay, but then the “completed” print prints 3 seconds later. please help. im suspecting that there may be something that i did wrong with the vector3 position so if im right please help anyway.
editing to clarify something, all other particles work immedeately. also, objecttoparticle is the part that i want the particles to be around.