Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I dont know how to make it separately ? :( (Help)

I want the part to spawn every 0.1 sec with transparency animation, but this code is doing individually, meaning 1 by 1.

Code:

group = Instance.new("Model", game.Workspace)
group.Name = "fountain"

function tran(part)
	for i=0, 1, 0.1 do
		wait(0.5)
		part.Transparency = i
	end
end

while wait(0.1) do
	local part = Instance.new("Part", game.Workspace.fountain)
	part.Name = "Color"
	part.Position = Vector3.new(0, 10, 0)
	part.BrickColor = BrickColor.Random()
	part.Parent = game.Workspace.fountain
	tran(part)
end

2 answers

found the answer

group = Instance.new("Model", game.Workspace)
group.Name = "fountain"

function tran(part)
	for i=0, 1, 0.1 do
		wait(0.5)
		part.Transparency = i
	end
end

while wait(0.1) do
	local part = Instance.new("Part", game.Workspace.fountain)
	part.Name = "Color"
	part.Position = Vector3.new(0, 10, 0)
	part.BrickColor = BrickColor.Random()
	part.Parent = game.Workspace.fountain
	coroutine.resume(coroutine.create(tran), part)

end

Split up the code for the Transparency then the code for spawning a block; every time it spawns the block put the transparency script inside of it. Sorry about whoever thumbs down you. This is a good legitimate post, please don't be discouraged.

This discussion is preserved as it was. New answers, comments, and votes are closed.