Trying to make a cool inventory system, something is getting in my way. no output errors. it just doesn’t work.
local inv = script.Parent.ScreenGui.Inv
local player = game.Players.LocalPlayer
game.UserInputService.InputEnded:Connect(function(key, gameProcessedEvent)
if not gameProcessedEvent and (key == Enum.KeyCode.E or key == Enum.KeyCode.ButtonB) and enabled == true then
if inv.Visible == false then
inv.Visible = true
enabled = false
inv.On:Play()
player.Character:FindFirstChild("Humanoid").WalkSpeed = 0
inv.Frame.Position = UDim2.new(0.5,0,0.3,0)
game.TweenService:Create(inv,TweenInfo.new(.25,Enum.EasingStyle.Linear,Enum.EasingDirection.Out),{Position = UDim2.new(0.5,0,0.5,0)}):Play()
inv.Static.Visible = true
wait(.1)
inv.Static.Visible = false
wait(.05)
inv.Static.Visible = true
enabled = true
elseif inv.Visible == true then
inv.Visible = false
inv.Off:Play()
enabled = false
player.Character:FindFirstChild("Humanoid").WalkSpeed = 16
inv.Static.Visible = false
enabled = true
end
end
end)```