Hello,i made this UI where when you press 'D' you first of all go from 'Equipment ' to 'Item' and then when you press D again it goes to 'Skills' (Image Linked)
and when you press A it goes from 'Skills' back to 'Item' and if you press A again to 'Equipment'
(The way it switches over is by making the Orange part which is an ImageLabel Visible and invisible (Equip, Items and skills have this ImageLabel which is called Hover))
how the UI looks: https://imgur.com/a/C3KxgxY
My problem is when i press 'D' it moves to items and then after instantly without any input it goes to skills
Im sorry if i missed anything and you are confused just comment ill reply and edit the post
The Script:
Mouse.KeyDown:connect(function(key)
if key == 'd' and WSM.Value == 1 and hftweened == false then
if Item_Equip_Skill == 0 then
sound2:Play()
wait(0.1)
holdframe:TweenPosition(UDim2.new(0,0,0,0),'Out' ,'Sine', 0.5 )
wait(0.5)
hftweened = true
EquipHover.Visible = true
ItemHover.Visible = false
SkillHover.Visible = false
wait(0.2)
Item_Equip_Skill = 1
end
if Item_Equip_Skill == 1 then
EquipHover.Visible = false
ItemHover.Visible = true
SkillHover.Visible = false
wait(0.2)
Item_Equip_Skill = 2
print(Item_Equip_Skill)
end
if Item_Equip_Skill == 2 then
EquipHover.Visible = false
ItemHover.Visible = false
SkillHover.Visible = true
wait(0.2)
Item_Equip_Skill = 3
print(Item_Equip_Skill)
end
end
end)

1 comment
KeyDown is deprecated switch to UserInputService