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

KeyInput problem help?

Asked by
NotSoNorm 777 Moderation Voter
9 years ago

idk but nothing happens when I press E, No errors, nothing.

local uis = game:GetService("UserInputService")
local plr = game.Players.LocalPlayer
local chatting = false

plr.Chatted:connect(function(msg)
    chatting = false
end)

uis.InputBegan:connect(function(input)
    if input == Enum.KeyCode.Slash and game.StarterGui:GetCoreGuiEnabled("Chat") then
        chatting = true
    elseif input == Enum.KeyCode.Return then
        chatting = false
    end

    if chatting == false then       
        if input == Enum.KeyCode.E then
            script.Parent.Parent.LeanBrick.BodyAngularVelocity.angularvelocity = Vector3.new(0,1.88,0)
        else
            script.Parent.Parent.LeanBrick.BodyAngularVelocity.angularvelocity = Vector3.new(0,0,0)
        end
    end
end)

1 answer

Log in to vote
2
Answered by
KoreanBBQ 301 Moderation Voter
9 years ago

You gotta do input.KeyCode==Enum.KeyCode.Slash

0
-shoots self- NotSoNorm 777 — 9y
0
ayy korean, I did this, and it still no workie. I think it's also something else but I tried to figure it out but to no avail NotSoNorm 777 — 9y
0
nvm played with it a little and got it to work NotSoNorm 777 — 9y
0
oh and also for your chatting thing theres inputbegan also returns gameprocessedevent which is set to true if youre typing or smth KoreanBBQ 301 — 9y
Ad

Answer this question