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

what's the code for Keydown function?

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

1 answer

✓ Accepted answer

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)

1 comment

0

Thanks!

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