✓ Accepted answer
problems
There are two core problems with this. Those being that KeyDown is deprecated, and that you are using StarterGui, rather than the PlayerGui.
The contents of the Starter Gui are cloned into each player's PlayerGui when they join, so modifying the startergui has no effect on the local player.
Fixes
Two things that should be done is
Fixed Script:
The fixed script should look like something on the lines of this:
local plr = game.Players.LocalPlayer
local UIS = game:GetService("UserInputService")
local yeet = plr.PlayerGui:WaitForChild("ScreenGui").background.barup
UIS.InputBegin:Connect(function(input,gpe)
if input.KeyCode == Enum.KeyCode.E then
yeet:TweenPosition(UDim2.new(0,64,0,333), 'Out', 'Bounce', 1)
end
end)
Other Notes
- Using KeyDown isn't inherently wrong, but as KeyDown is deprecated, it is considered bad practise to do so.
Hopefully this helped!
2 comments
no this will run as long as the key e is down and thats not what this user wants
Thanks!