debounce = true script.Parent.Touched:connect(function(hit) local H = hit.Parent:FindFirstChild("Humanoid") if H then if debounce == true then local Player = game.Players:GetPlayerFromCharacter(hit.Parent) local Gui = Player.PlayerGui:FindFirstChild("Teleport1") if Gui then Gui.Enabled = true else warn("bruh nothin her") end wait(0.5) debounce = false end end end)
so i put a warn in the script if the gui is there but no it warned me so when i look at the player Gui iTS THERE WHAT WHAT IS IT DOING!!
I assume this is a Server Script based on how its written, however the Server cannot read or change items in the PlayerGui without the use of a Remote Event / Function, only the client can do this.
Since you only want to open a Gui on the Player its best to keep the entire script Localized
Local Script in StarterGui
local player = game.Players.LocalPlayer local debounce = true workspace.Part.Touched:Connect(function(hit) local H = hit.Parent:FindFirstChild("Humanoid") if H then if debounce == true local Gui = script.Parent:FindFirstChild("Teleport1") if Gui then Gui.Enabled = true else warn("bruh nothin her") end wait(0.5) debounce = false end end end)