Edit: I just want to know, how to check which player Pressed the key
So Basically, If First player on the table, Pressed the key, let's say a print happens. How can I Do That?
I tried = if i[1].key.KeyCode == Enum.KeyCode[playersInRoomOne] then but it's not working, I don't get any errors
Local Script
local remote = game.ReplicatedStorage.RoomsStringValues.RoomOne.RoomOneEvent
local UIS = game:GetService("UserInputService")
local playerOneString = game.ReplicatedStorage.RoomsStringValues.RoomOne.PlayerOne
local playerTwoString = game.ReplicatedStorage.RoomsStringValues.RoomOne.PlayerTwo
local playersInRoomOne = {playerOneString, playerTwoString}
local allTheKeyWords = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X","Y","Z"}
local randomKeyChooser = allTheKeyWords[math.random(1, #allTheKeyWords)]
local isThereAWinner = false
print("Players in game are: "..table.concat(playersInRoomOne, ", "))
UIS.InputBegan:Connect(function(key)
-- The Code should be here for player 1
if key.KeyCode == Enum.KeyCode[randomKeyChooser] then
print("Player 1 pressed it")
else
print("Player 2 pressed it")
end
end)

4 comments
LocalScript -> Remote Event/Remote Function -> Server Script. You can only detect input from a specific player using a LocalScript. If you want to send the input to the server, you will have to use a RemoteEvent to send the input, and a ServersScript to handle the repsonse.
I know that, this is a local script, now pls read my question, and if you know the answer, let me know
Please put more information so people know that this is a LocalScript as there is nothing that shows you are using a LocalScript.
Ok My Bad, can you help me :/