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

Error on line 20 Expected <eof>, got 'end'?

Asked by 6 years ago
Edited 6 years ago

Line 20 Expected <eof>, got 'end'

Any fix to this? Can't seem to figure what is wrong.

01game.Players.PlayerAdded:Connect(function(player)
02    player.CharacterAppearanceLoaded:Connect(function(character)
03    player.Chatted:Connect(function(msg)
04        msg = msg:lower()
05        if (msg == "money") then
06            if (player.Character ~= nil) then
07                local humanoid = character:WaitForChild("Humanoid")
08                    if player.Name == "LoganboyInCO" then
09                        humanoid:AddAccessory(game.ReplicatedStorage.moneyrain)
10                            end
11                            humanoid.Died:Connect(function()
12                                character:FindFirstChild("moneyrain").Parent = game.ReplicatedStorage
13                                game.ReplicatedStorage.moneyrain:Clone()   
14                            end)
15                        end
View all 21 lines...

wow i hate autism

1 answer

Log in to vote
2
Answered by 6 years ago
Edited 6 years ago

functions with their structures defined as (function() have a parenthesis at the end, if statements have their code blocks end as end not end).

01game.Players.PlayerAdded:Connect(function(player)
02        player.CharacterAppearanceLoaded:Connect(function(character)
03        player.Chatted:Connect(function(msg)
04            local msg = msg:lower()
05            if (msg == "money") then
06                if (player.Character ~= nil) then
07                    local humanoid = character:WaitForChild("Humanoid")
08 
09                        if player.Name == "LoganboyInCO" then
10                            humanoid:AddAccessory(game.ReplicatedStorage.moneyrain)
11                         end
12 
13                                humanoid.Died:Connect(function()
14                                   character:FindFirstChild("moneyrain").Parent =
15game.ReplicatedStorage
View all 24 lines...
Ad

Answer this question