I'm trying to implement a menu in my game, and I'm having trouble. I can't see whats wrong. Any help would be appreciated, thank you.
function onKeyPress(inputObject, gameProcessedEvent) if inputObject.KeyCode == Enum.KeyCode.M then game.Player.LocalPlayer.PlayerGui.Menu.Enabled = true end end game:GetService("UserInputService").InputBegan:connect(onKeyPress)
(This is inside StarterPlayer.StarterPlayerScripts, and is a LocalScript)
Error:
Script 'Players.jetpush123.PlayerScripts.LocalScript', Line 3 Player is not a valid member of DataModel
Add a game.Players.player, not game.player. All players are stored in Players.
Player is not a valid member of DataModel
I assume you're trying to index the Players
service.
You put Player
but the players service is called Players
Change game.Player
to game.Players
or alternatively game:GetService("Players")