Soooo, i want a gui,whose visible property is set to false, to be set to true after my charcter touched a part. The part is in the workspace, the text label is parented to a frame which is parented in a screen gui, and the script i work in is a normal one
local part = script.Parent part.Touched:Connect(function(hit) local hum = hit.Parent:FindFirstChild("Humanoid") if hum then local frame = game.StarterGui.ScreenGui.Frame if frame.Visible == false then frame.Visible = true end end end)
Thanks for the help in advance
Hi! so the issue would be comming from line 5
local frame = game.StarterGui.ScreenGui.Frame
because that would not affect the GUI of your player, notice when you get in a game under Players you have PlayerGui so thats what you want to set the visibility
So firstly you have to get the Gui of the Player, not the Gui in StarterGui
local part = script.Parent part.Touched:Connect(function(hit) local hum = hit.Parent:FindFirstChild("Humanoid") if hum then -- hit.Parent is the character so the line below gets player's folder from the character local p = game.Players.getPlayerFromCharacter(hit.Parent) -- so replace your frame variable with the player's ScreenGui local frame = p.ScreenGui.Frame if frame.Visible == false then frame.Visible = true end end end)