as the title said, how do i check if a specific player presses a key? Ive tried to do
local cool = {"Cill_Roblox"}
local gui = script.Parent
game.Players.PlayerAdded:Connect(function(player)
if player.Name == cool then
if game:GetService("UserInputService"):IsKeyDown(Enum.KeyCode.L) then
gui.Enabled = true
end
end
end)
but that doesnt work since playeradded only checks once as far as i know and
local cool = {"Cill_Roblox"}
local gui = script.Parent
local guy = false
local uis = game:GetService("UserInputService")
game.Players.PlayerAdded:Connect(function(player)
if player.Name == cool then
guy = true
end
end)
uis.InputBegan:Connect(function(input, gameProccesedEvent)
if input.UserInputType == Enum.KeyCode.L then
if guy == true then
gui.Enabled = true
end
end
end)
ive tried looking stuff like "how to check if specific player presses a key roblox" but found nothing on this so far. anyone know something about this? any help is appreciated

1 comment
UIS does not function on the server, it's client-only