function onKeyPress(inputObject, gameProcessedEvent) if inputObject.KeyCode == Enum.KeyCode.Return then --trying to get the player's name here. end end game:GetService("UserInputService").InputBegan:Connect(onKeyPress)
would it be possible to get the player's name from this? (server script in ServerScriptService)
or would i have to do this another way?
Hey RobloxianDestroy,
StarterGui
StarterPack
StarterPlayerScripts
StarterCharacterScripts
local player = game.Players.LocalPlayer;
local player = game.Players.LocalPlayer; local uis = game:GetService("UserInputService"); uis.InputBegan:Connect(function(object, gp) if object.KeyCode == Enum.KeyCode.Return and not gp then print(player.Name); end end)
~~ KingLoneCat