I'm trying to make a custom playerlist and I made an Input Began / Input Ended Function which is when you press tab the playerlist is visible.
[This is tricky because there are no errors.]
Code:
local PlayerList = game.StarterGui:WaitForChild("PlayerList") local ScrollingFrame = PlayerList:WaitForChild("ScrollingFrame") local Player = game.Players.LocalPlayer local Template = game.StarterGui.PlayerList.Template local Frame = game.StarterGui.PlayerList.Template:Clone() -- UI Script UIS.InputBegan:Connect(function(Input) if Input.KeyCode == Enum.KeyCode.Tab then PlayerList.Enabled = true ScrollingFrame.Visible = true end end) UIS.InputEnded:Connect(function(Input) if Input.KeyCode == Enum.KeyCode.Tab then PlayerList.Enabled = false ScrollingFrame.Visible = false end end)
Please help me resolve this issue.
local PlayerList = game.Players.LocalPlayer.PlayerGui:WaitForChild("PlayerList") local ScrollingFrame = PlayerList:WaitForChild("ScrollingFrame") local Player = game.Players.LocalPlayer local Template = Player.PlayerGui.PlayerList.Template local Frame = Player.PlayerGui.PlayerList.Template:Clone() local UIS = game:GetService("UserInputService") -- UI Script UIS.InputBegan:Connect(function(Input, gameprocessed) if Input.KeyCode == Enum.KeyCode.Tab then PlayerList.Enabled = not PlayerList.Enabled ScrollingFrame.Visible = not ScrollingFrame.Visible end end)