****code = "testing" --type your 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 input.Text = 'Correct' wait (1) input.Text = 'Enter' else input.Text = 'Invalid/Used' wait (1) input.Text = 'Enter' end
thats my script i put and it says expected end to close function at line 5 tried couple times to fix but it ain't gonna fix.

6 comments
Please put your code in a code block
yea, also organize it, going for organization not space conservation
Please use a code block. Also, it means you forgot an end. Add one accordingly.
--he tried--
I think your missing a “)” as well. Try “end)”.
If you're ending a function, then it's "end)", everything else is "end"