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 Onclick Transparency script to a vehicle?

Ive been trying for ages to makeing an onclick transparency script and it wont work.

1 answer

Here is some code with a toggling Transparency Function

Before anything, add a ClickDetector inside the part you're working with. This script below would be placed inside the brick. Also, add a BoolValue inside as well.

brick = script.Parent
bool = script.Parent.BoolValue

function onClicked(playerWhoClicked)
	bool.Value = not bool.Value
		if bool.Value == true then
			brick.Transparency = .5
		else
			brick.Transparency = 0
	end
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

I hope this was helpfull.

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