You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I want to make my game only recognize a keystroke rather than mouse input
What is the issue? Include screenshots / videos if possible!
Roblox User Input System is Equating Mouse Movement to Keyboard Input
if input.UserInputType == Enum.UserInputType.Keyboard and input.UserInputType ~= Enum.UserInputType.MouseMovement then
for i, v in pairs(clonedLoadingScreen:GetDescendants()) do
if v:IsA("Frame") then
tweenService:Create(v, TweenInfo.new(3), {BackgroundTransparency = 1}):Play()
elseif v:IsA("TextLabel") or v:IsA("TextButton") then
tweenService:Create(v, TweenInfo.new(1), {TextTransparency = 1}):Play()
elseif v:IsA("ImageLabel") or v:IsA("ImageButton") then
tweenService:Create(v, TweenInfo.new(3), {ImageTransparency = 1}):Play()
end
end
end
What solutions have you tried so far? Did you look for solutions on the Developer Hub? I’ve tried passing “input.UserInputType ~= Enum.UserInputType.MouseMovement” through the if statement and no result
if input.UserInputType == Enum.UserInputType.MouseMovement then
for i, v in pairs(clonedLoadingScreen:GetDescendants()) do
if v:IsA(“Frame”) then
tweenService:Create(v, TweenInfo.new(3), {BackgroundTransparency = 0}):Play()
elseif v:IsA(“TextLabel”) or v:IsA(“TextButton”) then
tweenService:Create(v, TweenInfo.new(1), {TextTransparency = 0}):Play()
elseif v:IsA(“ImageLabel”) or v:IsA(“ImageButton”) then
tweenService:Create(v, TweenInfo.new(3), {ImageTransparency = 0}):Play()
end
end
end
if input.UserInputType == Enum.UserInputType.MouseButton1 then
for i, v in pairs(clonedLoadingScreen:GetDescendants()) do
if v:IsA(“Frame”) then
tweenService:Create(v, TweenInfo.new(3), {BackgroundTransparency = 1}):Play()
elseif v:IsA(“TextLabel”) or v:IsA(“TextButton”) then
tweenService:Create(v, TweenInfo.new(1), {TextTransparency = 1}):Play()
elseif v:IsA(“ImageLabel”) or v:IsA(“ImageButton”) then
tweenService:Create(v, TweenInfo.new(3), {ImageTransparency = 1}):Play()
end
end
end
end)