(By On-Touch I mean a Person touches it not a brick) How would I make that? I'm new to the Inserting GUIs into someones StarterGUI. Please help :)
COMMUNITY QUESTION
How do I make a brick that when On-Touch a GUI Pops up?
2 answers
Not a request site, but since the other guy messed up a bit, I'll lead you towards the correct path.
GUI = game.Lighting["Gui Name Here"] -- Define the path of the GUI (Should not be in the StarterGui)
script.Parent.Touched:connect(function(hit) -- Touched event and connection
if hit.Parent and game.Players:GetPlayerFromCharacter(hit.Parent) then -- Checks if it's a player. (I use the GetPlayerFromCharacter method just incase you have some other object with a humanoid.)
p = game.Players:GetPlayerFromCharacter(hit.Parent) -- Sets the Player variable
if not p.PlayerGui:FindFirstChild("Gui Name Here") then -- Check if they don't have it
GUI:clone().Parent = p.PlayerGui -- clones it to their PlayerGui
end
end
end)
This is not a request site, but this is how:
myGui = game.Lighting:findFirstChild("YourGUINameHere") -- pepps, please, FindFirstChild and findFirstChild works, stop blaming me calling this an error. Try it yourself
function showItNow(part)
if part.Parent:findFirstChild("Humanoid") ~= nil then
if game.Players:GetPlayerFromCharacter(part.Parent).PlayerGui:findFirstChild(myGui.Name) == nil then myGui:clone().Parent = game.Players:GetPlayerFromCharacter(part.Parent).PlayerGui end
end
end
script.Parent.Touched:connect(showItNow)
Hope this helps! Thanks, marcoantoniosantos3
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
Its "FindFirstChild" You need to use capitalization. Also its not script.Parent.onTouch:connect(showItNow) its Touched:connect(showItNow)
Sorry about event, but no, FindFirstChild and findFirstChild works
People, let's see if my edit makes your dislike a like. I hope it works for you