This is a LocalScript I have for a leave button GUI when you teleport somewhere, you're supposed to touch a wall, get teleported and you can press the GUI to leave, but the GUI isn't appearing when I teleport. (LocalScript in StarterPlayerScripts)
game.StarterGui:WaitForChild("LeaveButtonGUI") game.StarterGui.LeaveButtonGUI:WaitForChild("LeaveButton") game.Workspace:WaitForChild("InsideContent") game.Workspace.InsideContent:WaitForChild("TPWallLeft") game.Workspace.InsideContent:WaitForChild("TPWallMiddle") game.Workspace.InsideContent:WaitForChild("TPWallRight") local LBGUIB = game.StarterGui.LeaveButtonGUI.LeaveButton local TPWallLeft = game.Workspace.InsideContent.TPWallLeft local TPWallRight = game.Workspace.InsideContent.TPWallRight local TPWall Middle = game.Workspace.InsideContent.TPWallMiddle local Player = game:WaitForChild("Players").LocalPlayer Player.CharacterAdded:Connect(function(Character) local HRP = Player.Character:WaitForChild("HumanoidRootPart") TPWallLeft.Touched:Connect(function(LeaveButtonAppear) LBGUIB.Visible = true end) end)
If I do it to the player's GUI it still doesn't do anything
game.StarterGui:WaitForChild("LeaveButtonGUI") game.StarterGui.LeaveButtonGUI:WaitForChild("LeaveButton") game.Workspace:WaitForChild("InsideContent") game.Workspace.InsideContent:WaitForChild("TPWallLeft") game.Workspace.InsideContent:WaitForChild("TPWallMiddle") game.Workspace.InsideContent:WaitForChild("TPWallRight") local Player = game:WaitForChild("Players").LocalPlayer Player.PlayerGui:WaitForChild("LeaveButtonGUI") local LocalPlayer = game:GetService("Players").LocalPlayer local LeaveButton = LocalPlayer.PlayerGui.LeaveButtonGUI.LeaveButton local LBGUIB = game.StarterGui.LeaveButtonGUI.LeaveButton local TPWallLeft = game.Workspace.InsideContent.TPWallLeft local TPWallRight = game.Workspace.InsideContent.TPWallRight local TPWall Middle = game.Workspace.InsideContent.TPWallMiddle Player.CharacterAdded:Connect(function(Character) local HRP = Player.Character:WaitForChild("HumanoidRootPart") TPWallLeft.Touched:Connect(function(LeaveButtonAppear) LeaveButton.Visible = true end) end)
You are editing the StarterGui's buttons, you need to use the localplayer's ui buttons
(also you can use "workspace" instead of "game.Workspace")
local LocalPlayer = game:GetService("Players").LocalPlayer local LeaveButtonGUI = LocalPlayer.PlayerGui.LeaveButtonGUI -- fix up the rest of the code to use the variable above, everything else works fine i assume