Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is my script for a lanyard clone giving me expected to close error? [solved]

Asked by 6 years ago
Edited by Shawnyg 6 years ago

I created this script like a month ago, I decided to use it in my game but it's not working. The output gives me this error:

"19:58:10.832 - Workspace.Staff Lanyard:12: 'end' expected (to close 'function' at line 5) near '<eof>'"

How do I fix this?

Here is my script:

01local lanyard = game:GetService("ServerStorage"):WaitForChild("Lanyard")
02GroupId = 4525647
03min = 3
04 
05game.Players.PlayerAdded:Connect(function(player)
06    player.CharacterAdded:Connect(function(character)      
07        if player:GetRankInGroup(GroupID) >= min then
08            local clonedlanyard = lanyard:Clone()
09            clonedlanyard.Parent = game.Workspace:WaitForChild(player.Name)    
10        end
11 
12end)
0
You forgot to put an end). Just put one at line 11. User#20279 0 — 6y
0
Include an additional end) on line eleven to close the function connected to the CharacterAdded event. User#25115 0 — 6y
0
Okay, thanks. It worked. I really appreciate it. TypicallyPacific 61 — 6y
0
No problem. Now that your question is solved, please put [Solved] in the title of your question, so that people know you no longer need help. User#25115 0 — 6y
0
Edit: Marked as solved Shawnyg 4330 — 6y

Answer this question