Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Change the GUI transparency when you touch a part?

Asked by 2 years ago

Hi, I'm trying to make it where when the player touches a certain part it will change the GUI's transparency but it didn't work.

local wall = workspace.wall
local frame = script.Parent.Parent.FRAME

if wall.Touched:Connect(onTouch) then
    frame.Visible = 0.5
end

What do i do?

2 answers

Log in to vote
0
Answered by 2 years ago

Issue is frame.visible visible can only be set to true or false So your going to need to go to the property tab under frame and look for background. and there should be something on the lines called BackgroundTransparency you can use that in your script instead. (It may not be called backgroundtransparency so make sure you check in the properties tab. Hope this helps!! Also I am on my iPhone so I can't check right now, but if you need me to I can check later.

Ad
Log in to vote
0
Answered by 2 years ago

Here's a few things to try:

1. Try putting the event outside of an if then because they do not need them to work

2. Change visible to Transparency if you want to change the transparency.

Bonus: Once you have this problem figured out you could make the transparency fade to 0.5. Just an idea.

Please comment on this answer if you have any questions!

Answer this question