So, I was having difficulty with my guis and then found out I had to edit them via the playergui and not startergui. However, when I'm doing this, it is making changes to everybody's PlayerGui.
I have simplified thelocal script, placed in PlayerScripts, so it is easier to read.
local tr = game.Workspace.EP1.tr --This is just a brick. local playergui = game.Players.LocalPlayer:WaitForChild("PlayerGui") tr.Touched:Connect(function(hit) ---brick is touched playergui.EP1.R.Enabled = true tr.BrickColor = BrickColor.new("Pink") end)
How can I assure that the ScreenGui object is only appearing on the screen of whoever touched the brick?
Thanks in advance
Welp if the local script doesn't work probably for u then i have another way :D This is activate the gui through the server, put this script inside a part you want to be touched
(Normal Script)
script.Parent.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then -- Check if it a character if yes, then: local player =game.Players:GetPlayerFromCharacter(hit.Parent) -- Get the player local GUI =player.PlayerGui:FindFirstChild("GUI") -- Your Gui GUI.Enabled = true -- Enable the GUI end end)
Hope that helped