Key is detected on every input

  1. If player presses G or C the gui on a player goes down and an event is fired.

  2. If you press any key, the gui goes down and the event is fired.

  3. Adding checks to assure it knows it is C or G

											if Key ~= "c" or "g" then
											print("pressed g")
											if db1 == true then return else
												print("pressed g1")

												if Int.Frame.c.Visible == true and Int.Adornee and Int.Frame.c.Msg.TextColor3 == Color3.fromRGB(255, 255, 255) then
													print("pressed g2")
													
												if string.upper(Key) == "G" or "C" then
													print("did this work?")
													if enabled == false then
														print("did this work?1")
														enabled = true


															
															print("did this work?1111")
															local value = Key

															Player.PlayerGui.InteractiveMenu.Click:Play()
															local action = Key
															spawn(function()
																wait(0.1)
																Int.Frame[Key].Up.Visible = false
																	Int.Frame[Key].Msg.TextColor3 = Color3.fromRGB(89, 255, 0)
																	Int.Frame[Key].Down.Visible = true
																if db1 == true then end
																db1 = true



																db1 = false
																wait(0.1)
																	Int.Frame[Key].Up.Visible = true
																	Int.Frame[Key].Msg.TextColor3 = Color3.fromRGB(255, 255, 255)
																	Int.Frame[Key].Down.Visible = false
																game.ReplicatedStorage:FindFirstChild('InteractionEvent'):FireServer(v, Key)
																game.ReplicatedStorage.Notification:FireServer(action, v.Name)
																enabled = false

																wait(3)
																end)
															end
														end
														
													end
													end

I’m confused on what you’re trying to do. Please describe it better and tell us what errors you’re encountering.

What is Key? I am assuming you are using UserInputService for this (as you should be), so I am going to assume that Key is InputObject.KeyCode. You will need to compare KeyCode to a KeyCode Enum, not a string.

If key == Enum.KeyCode.G then

I was able to fix this issue, though I’ve acquired another one. Everytime I press G to unweld them from myself, they fall on the floor and teleport away.

Here’s a video of it to give more detail
robloxapp-20220310-1934574.wmv (1.6 MB)