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

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

Asked by 5 years 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.)

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

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
0
Answered by 5 years ago
Edited 5 years ago

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

workspace.NameOfPart.Touched:Connect(function()
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!

Ad
Log in to vote
0
Answered by 5 years ago

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

script.Parent.Touched:Connect(function(part)
local h = part.Parent:FindFirstChild("Humanoid")
if h ~= nil then
--do anything
end
end)

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:

game.Players[part.Partent.Name].PlayerGui.ScreenGui

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