I want to make Pop Up's by a gui to represent my character thinking. How may I do this local? Like only the person who touched the part only sees it ?
How do I make a Pop Up Gui when touched a invisible part?
1 answer
There are a lot of different ways to make a GUI appear. You can use RemoteEvents or server scripts. But the simplest way would be through local scripts. But, if you want the GUI to pop up whenever you touch a part in the workspace you can't use a local script since it doesn't run there. What you could do instead is to make a server script that communicates with the local script through RemoteEvents whenever the part get's touched. Also, just to respond to the title, it doesn't matter if a part is invisible or if the CanCollide is set to false. The Touched event will still fire.
Now, I'm assuming that when you ask about "how to make it local" you mean that only one player (the player) that touches the part sees the GUI. A way to do this would be by getting the name of the model (Characters name) and then either using an In pairs loop or using the GetPlayerFromCharacter function.
To get to the point here is what it could look like:
local ScreenGui = Instance.new("ScreenGui")
local Frame = Instance.new("Frame")
Frame.Size = UDim2.new(1,0,1,0)
Frame.Parent = ScreenGui
script.Parent.Touched:Connect(function(part)
if part.Parent:FindFirstChild("HumanoidRootPart") then -- If the model contains a HumanoidRootPart then continue.
local Character = part.Parent -- The parent of the part that touched the object.
local Player = game.Players:GetPlayerFromCharacter(Character) -- Getting the player.
ScreenGui.Parent = Player:WaitForChild("PlayerGui") -- Setting the parent of the GUI to your PlayerGui so that it only shows up for you.
end
end)
2 comments
If anything i've written is incorrect or inaccurate please comment. I don't want to spread misinformation.
Thanks! The script works perfectly! I just kinda modified it a bit so it matches the color etc.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
You use a local script...
In a local script you can run a touch function, when it activates create one of those 3D Gui's