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

Guys how do you make a GUI appear when you touch it then disappear when the object is gone? [closed]

Asked by 9 years ago

I try 2 times trying to script it but I couldn't then I tried searching it up I found nothing so this is why I need your help...

0
Please post the code you've attempted to write. Scripting Helpers is not a requests site, and we cannot help you learn Lua if we simply provide you with working code. adark 5487 — 9y

Closed as Not Constructive by adark and Redbullusa

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
yoshiegg6 176
9 years ago

Make a GUI and put it in server storage. Name it GUI. Now, put this into a script in the brick.

script.Parent.Touched:connect(function(hit)
game.ServerStorage.GUI:Clone().Parent = hit.Parent:GetPlayerFromCharacter().Parent.PlayerGUI
end)

script.Parent.Touchended:connect(function(hit)
if hit.Parent:GetPlayerFromCharacter.Parent.PlayerGUI:FindFirstChild("ScreenGUI") and hit.Parent:GetPlayerFromCharacter.Parent.PlayerGUI:FindFirstChild("ScreenGUI").Name == "GUI" then
hit.Parent:GetPlayerFromCharacter.Parent.PlayerGUI:FindFirstChild("ScreenGUI"):Destroy()
end
end)

I'm not sure if I have enough ends.

Ad
Log in to vote
-1
Answered by
iFlusters 355 Moderation Voter
9 years ago

This is not a request site. You could have atleast tried to give us some of your code. So all I can give you is:

-- onTouch function
-- Find if the script.Parents(hit) has a humanoid
-- Clone a gui from somewhere, Replicated Storage is recommended
-- Then either have a script in the Gui itself that is disabled after the player hits the part.
-- Or have the script remove it ifthe player is not touching the part.
0
Sorry I'm new to this i didn't know. Ewarr1011 0 — 9y