Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

mouse.KeyDown isn't registering?

Asked by 9 years ago

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

Log in to vote
1
Answered by 9 years ago

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

Ad

Answer this question