So, for a game, I wanted to use a function that fires every time a player presses one. Except, it must be a specific player. Is there any way that I can figure out the player that is doing the input, during the event of InputBegan and InputEnded?
UserInputService is a service only accessible in localscripts, and localscripts can also view a property of the Players service that tells you what player the script is owned by
local player = game.Players.LocalPlayer -- the player local uis = game:GetService("UserInputService") uis.InputBegan:connect(function() print(player.Name..' pressed something') end)