Ive been trying for ages to makeing an onclick transparency script and it wont work.
COMMUNITY QUESTION
How do I make a Onclick Transparency script to a vehicle?
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.
