Hello! I am making a start interaction GUI for a rempy-styled chat system.
Here's the script.
This script is a Local script inside of a Dummy's lower torso
The selection is a frame similar to what the background frame is but a different color and invisible and it grows in size to give some feedback when you press the key.
local userinput = game:GetService("UserInputService")
local tweenservice = game:GetService("TweenService")
local TweenInfo = TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.In, 0, false, 0)
local tween1 = tweenservice:Create(script.Parent.selection.Size, TweenInfo, {UDim2.new(0, 200, 0, 60)})
local tween2 = tweenservice:Create(script.Parent.selection, TweenInfo, {UDim2.new(0, 1, 0, 60)})
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
mouse.KeyDown:Connect(function(key)
if key:lower() == "f" or key:upper() == "F" then
script.Parent.selection.Visible = true
print("yep")
tween1:Play()
end
end)
Image of the setup and Logs:
Things I've tried
I've used the Keydown method prior to this but while I was searching for a solution myself on the Roblox developer forum I was recommended to use this way to get key pressed.
The errors you do see in the output are all unrelated to it and are other scripts I've imported from another one of my games which I am not working in right now since it is laggy, so the other scripts dont work quite yet as I need to finish this text GUI before I can implement them into the GUI,
Any help is welcome and appreciated, thank you.
Edit: While trouble shooting this again I realised I was changing the size in the tween incorrectly, changed it to the correct way, problem still remains.

1 comment
Hello, Thank you for your response and it works! and for user input service I initially thought that was the issue so I was searching forms to fix a problem that didn't exist, Thank you for helping me with this.