script 1
local magic = game.Players.LocalPlayer.Backpack:WaitForChild("Magic")
local key = script:WaitForChild("Key")
game:GetService("UserInputService").InputBegan:connect(function(KeyInput)
if KeyInput.KeyCode == Enum.KeyCode["Key"] then
print("OMG")
end
end)
script 2
local magic = game.Players.LocalPlayer.Backpack:WaitForChild("Magic")
local text = script.Parent.Input
local key = magic:WaitForChild("Key")
script.Parent.Input:GetPropertyChangedSignal("Text"):Connect(function()
if magic.MagicLOL.Value == true then
key.Value = text.Text
wait (1)
print(key)
end
end)
can anyone help me?

1 comment
Script 1, don't wrap in quotations, just leave the variable Key as itself ----> [Key]