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

face change on keydown help?

`` local m =game.players.LocalPlayer:GetMouse() db=true m.KeyDown:connect(function(q) q=q:Lower() if k="l" then if db==true then game.Players.LocalPlayer.Character.Head.face.Texture = "rbxassetid://1296295820" db=false wait(3) db=true end end end)

2 comments

0

if k="l" then on that bit i meant q

0

Please use a code block! Select all the code and press the blue Lua button.

2 answers

You need to put Capital "P" in local m = game.Players.LocalPlayer:GetMouse()

1 comment

0

And a lowercase "L" in

You should be using UserInputService to check if the player presses a key.

local UserInputService = game:GetService('UserInputService')
local player = game.Players.LocalPlayer
local Debounce = false

UserInputService.InputBegan:Connect(function(Input,GPE)
	if Input.KeyCode == Enum.KeyCode.Q then
		if Debounce == false then
			Debounce = true
			player.Character.Head.face.Texture = 'rbxassetid://1296295820'
			wait(3)
			Debounce = false
		end
	end
end)

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