(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 :)
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)
<Edited it a little>
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