How do i Make a Random Part on RandomDot it Disappear and Appear

i think you type “corountine” intes “coroutine” [letter n]

coroutine.resume(coroutine.create(funtion()
			part.Transparency = 1

that werid i got redline at “funtion” and “part”

4 Likes

Yea thats right, I can’t open studio to see if the function is right cuz my laptop is busted and it would took pretty long, and about the redline you got, its function, not funtion, thats a error of me, sorry

3 Likes

Yey It Work, Thank you So much, also it alright

4 Likes

Just learned how to put text in coding style in a topic lol, gonna change the solution to coding style so it looks better/its better

3 Likes

Ah alright,
What if i use math.random? like
local seed = math.random(0.5,1)

1 Like

You can’t, but what you can do is:

math.random(5,10)/10

So if it is 10, it will get divided by 10, becoming 1, 5 for 0.5, 6 for 0.6 and etc

2 Likes

How about this?

local ThePower = script.parent.RandomDot
local GroupChilds = ThePower:GetChildren()
local part = nil

for i = 1,math.random(1,2) do
	part = GroupChilds[math.random(1,#GroupChilds)]
	if part:IsA("Part") then
		coroutine.resume(coroutine.create(function()
			part.Transparency = 1
			part.CanCollide = false
			task.wait(1)
			part.CanCollide = true
			part.Transparency = 0
		
	end))
end
end
``
1 Like

image
one of it it Disapper but can’t Apper

1 Like

“i” should be 0 (I think?), so 1 does one times, 2 does two times. Also put the while back behind the for do, since without it that will just repeat one time, not repeatedly, thats also why it only disappear, but can’t appear

1 Like

image
Like this, also i have alot redline

1 Like

That part should be:

while task.wait(0.5) do
	for i = 0,math.random(1,2) do
		part = GroupChilds[math.random(1,#GroupChilds)]
		if part:IsA("Part") then
			coroutine.resume(coroutine.create(function()
				part.Transparency = 1
				part.CanCollide = false
				task.wait(1)
				part.CanCollide = true
				part.Transparency = 0
			end))
		end
	end
end
2 Likes

Yippee! it Work!
image
Thank you so Much!

3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.