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

how do I make a block that fades when you get close to it?

how do I make a block that fades when you get close to it ( about 10 blocks away )

1 answer

#For Future Reference: Please at least try writing the code. This is a helping site, not a requesting site.

You want to build a cylindrical part, and a normal part. Cylinder because of rules of PI

Build a cylinder part, say a radius of 15. On top of it, insert a part. Remember to anchor both of them.

Then, Put the following script in the cylinder.

-- Declaration Section 

local cylinder = script.Parent
local part = game.workspace.Part
local hasBeenFaded = false 

-- Processing Section 

cylinder.Touched:Connect(function()
	if hasBeenFaded == false then 
		for number = 0, 1, 0.1 do
			part.Transparency = number
			wait()
		end
		hasBeenFaded = true 
	end 
end)

If this answer helped, please flag as question answered. Have a lovely day of coding!

1 comment

0

did not work

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