****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.
01 | code = "testing" |
02 | --type your code |
03 | local gear = game.ReplicatedStorage:WaitForChild( 'Handgun' ) |
04 | Input = script.Parent.Parent.CodeInput |
05 | Output = script.Parent |
06 | Output.MouseButton 1 Down:Connect( function () |
07 | if Input.Text = = code then |
08 | gear:Clone().Parent = game.Players.LocalPlayer.Backpack |
09 | gear:Clone().Parent = game.Players.LocalPlayer.StarterGear |
10 | input.Text = 'Correct' |
11 | wait ( 1 ) |
12 | input.Text = 'Enter' |
13 | else |
14 | input.Text = 'Invalid/Used' |
15 | wait ( 1 ) |
16 | input.Text = 'Enter' |
17 | end |
18 | end ) |
You forgot to add the "end)" at the end of the code block.