i know some basic scripting, but i would like to know how to do something with a key pressed
So, you're asking for a keydown event and all you need to do is this.
--In a local script
local Player = game.Players.LocalPlayer --Get the player local Mouse = Player:GetMouse() --Get the Player's mouse Mouse.KeyDown:connect(function(key) key = key:lower() if key == "" then -- in strings put the key for example q --What you want the player to do end end)
This wiki post might be a good help for you: http://wiki.roblox.com/index.php?title=Keyboard_input
And it clearly states that the mentioned KeyDown way of getting Keyboard Input is deprecated and should not be used.
This works in my GUI put into StarterGUI, so hopefully you can find use for this:
local player = game.Players.LocalPlayer function clicked(Key) if Key == "z" and player.Name == "USERNAME" then game.Players.LocalPlayer.PlayerGui.GUINAME.FrameName.Visible = true end end game.Players.LocalPlayer:GetMouse().keyDown:connect(clicked)