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

KeyInput problem help?

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

✓ Accepted answer

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

4 comments

0

-shoots self-

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

0

nvm played with it a little and got it to work

0

oh and also for your chatting thing theres inputbegan also returns gameprocessedevent which is set to true if youre typing or smth

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