code = "testing" --type your code
code2 = "power"--type your second code
local gear = game.ReplicatedStorage:WaitForChild('Handgun')
Input = script.Parent.Parent.CodeInput
Output = script.Parent
Output.MouseButton1Down:Connect(function()
if Input.Text == code then
gear:Clone().Parent = game.Players.LocalPlayer.Backpack
gear:Clone().Parent = game.Players.LocalPlayer.StarterGear
if Input.Text == code then Input.Text = 'Correct'
wait (1)
Input.Text = 'Enter'
else
Input.Text = 'Invalid/Used'
wait (1)
Input.Text = 'Enter'
end
end
end)
code2 = "power" --type your code
code = "testing" --type your second code
local gear = game.ReplicatedStorage:WaitForChild('Sword')
Input = script.Parent.Parent.CodeInput
Output = script.Parent
Output.MouseButton1Down:Connect(function()
if Input.Text == code2 then
gear:Clone().Parent = game.Players.LocalPlayer.Backpack
gear:Clone().Parent = game.Players.LocalPlayer.StarterGear
if Input.Text == code2 then
Input.Text = 'Correct'
wait (1)
Input.Text = 'Enter'
else
Input.Text = 'Invalid/Used'
wait (1)
Input.Text = 'Enter'
end
end
end)
i did this thing and it didnt work. i tried like many other solutions like adding if Input.Text == code2 or code then doing it but it didnt work. The Input doesn't change when I put like dfkdj.

3 comments
i should copy and paste this ??
the nil value for the code isnt working
Whoops - "Input.Text" is always "Correct" at that point. I moved the line up to before Input.Text is changed; it should work now. (If it wasn't clear, the bottom script replaces your 2 other ones.)