I am trying to make a command bar so you can type commands and run stuff even though you are not the owners. I already got the tween function down but I wanna know how to do the key bind. I used this code
game:service'UserInputService'.InputBegan:connect(function(inputObject, gameProcessedEvent) if (inputObject.KeyCode=='W') then print'Hi.'; end; end);
Here you go, also your script is full of deprecated ways my man
local UIS = game:GetService("UserInputService") local Player = game.Players.LocalPlayer function InputBegan(input, typing) if (input.KeyCode == Enum.KeyCode.W) and not typing then GuiObject:Clone().Parent = Player:WaitForChild("PlayerGui") end end UIS.InputBgan:Connect(InputBegan)
And if you're looking forward to using a more unique way, I recommend learning about ContextActionService