Still have questions? Join our Discord server and get real time help.
Log in to vote

How do you make an Ontouched event effect GUIs? [closed]

Asked by 1 year ago

I am wanting it so when the player touches a certain part, it will effect a GUI. (In my case, change the transparency of the GUI.)

then put an ontouched in a part in a script and make it so the gui changes transparency greatneil80 2240 — 1y
lol Questofmagicfarts 55 — 1y

Closed as Not Constructive by Leamir and cmgtotalyawesome

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

2 answers

Log in to vote
Answered by 1 year ago
Edited 1 year ago

When the player touched it we want it to activate the GUI so use a Local Script and then do this:

local plrname = game.Players.LocalPlayer.Name

and then activate the GUI:

game.Players[plrname]:FindFirstChild("Name of  GUI").FrameTransparency = --Insert number

change names and stuff like that But not the plrname!!

I hope it helped!

Log in to vote
Answered by 1 year ago

well first you want to detect when a player hits the part

local h = part.Parent:FindFirstChild("Humanoid")
if h ~= nil then
--do anything

and you can replace the "do anything" part with anything, in this case you want a gui to pop up

replace "do anything" with this:


and now you are in the screengui of the player do whatever you want then