I want to be able to step on an object and then press f to make something happen but it wont work. Help please!
if game.Workspace.Part.Touched:connect(function()) then
Player = Game.Players.LocalPlayer Mouse = Player:GetMouse() Mouse.KeyDown:connect(function(key) print(key) end)

1 comment
You used an if then statement where you should not have, you should have defined the player, and gotten them from their character, or fired an event to do so... if applicable. You used a local script function in a script, as such player is undefined... you got mouse from something that is nil, you missed 2 ends...