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

what's the code for Keydown function?

Asked by 7 years ago

What's the function for Keydown (where you hold a key down and it functions) Example: K > New Part

1 answer

Log in to vote
0
Answered by 7 years ago

It needs to be in a local script in StarterGui or StarterPack

local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()

Mouse.KeyDown:connect(function(Key)
    if Key == "k" then
    Instance.new("Part",game.Workspace)--Put here what you want to happen when the key is pressed
    end
end)
0
Thanks! IfIWasntSoSwag 98 — 7y
Ad

Answer this question