Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

mouse.KeyDown isn't registering?

Nothing is being printed when I press any key.

--TetherBLOX

one = script.Parent.Part1
two = script.Parent.Part2
three = script.Parent.Part3


one.Visible = true
ew = false
go = true

function new()
    mouse = game.Players.LocalPlayer:GetMouse()
    mouse.KeyDown:connect(function(keyPressed)
	print('A key, '..keyPressed..', has been pressed.')
        if keyPressed == 'f' and go then
            go = false
            one.Visible = false
            two.Visible = true
            wait(1)
            ew = true
            if ew == true then
                two.Visible = false
                three.Visible = true
                wait(3)
                three.Visible = false
            end
        end
    end)
end
game.Players.PlayerAdded:connect(new)

1 answer

Do you have this as a LocalScript? LocalPlayer only works in a LocalScript.

This discussion is preserved as it was. New answers, comments, and votes are closed.