local UserInputService = game:GetService('UserInputService')
UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
if input.UserInputType == Enum.UserInputType.Keyboard then
if input.KeyCode == Enum.KeyCode.One then
slot:TweenPosition(
UDim2.new(0.316, 0,0.89, 0), --makes it go to another/new position if that makes sense
"Out",
"Quad",
.1,
true
)
else
slot:TweenPosition(
UDim2.new(0.316, 0,0.898, 0), --makes it go back to it's normal position
"Out",
"Quad",
.1,
true
)
end
end
end)```
local slot = script.Parent
local UserInputService = game:GetService("UserInputService")
local keypress = {Enum.KeyCode.One,0}
UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
if not(gameProcessedEvent) then return end
if input.UserInputType == Enum.UserInputType.Keyboard then
if input.KeyCode == keypress[1] then
if (keypress[2] == 0) then
keypress[2] = 1
slot:TweenPosition(
UDim2.new(0.316, 0,0.89, 0), --makes it go to another/new position if that makes sense
"Out",
"Quad",
.1,
true
)
else
slot:TweenPosition(
UDim2.new(0.316, 0,0.898, 0), --makes it go back to it's normal position
"Out",
"Quad",
.1,
true
)
end
end
end
end)
while wait() do
if keypress[2] == 1 then
wait(1) -- you can change
keypress[2] = 0
end
end