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

face change on keydown help?

Asked by 6 years ago

`` 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)

0
if k="l" then on that bit i meant q Jellal27 0 — 6y
0
Please use a code block! Select all the code and press the blue Lua button. Mayk728 855 — 6y

2 answers

Log in to vote
0
Answered by 6 years ago

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

0
And a lowercase "L" in jinsouGod 0 — 6y
Ad
Log in to vote
0
Answered by
Mayk728 855 Moderation Voter
6 years ago

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)

Answer this question