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:

local lanyard = game:GetService("ServerStorage"):WaitForChild("Lanyard")
GroupId = 4525647
min = 3

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)       
        if player:GetRankInGroup(GroupID) >= min then
            local clonedlanyard = lanyard:Clone()
            clonedlanyard.Parent = game.Workspace:WaitForChild(player.Name)     
        end

end)
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