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

end statements are having an error?

Asked by 4 years ago
01local MarketPlaceService = game:GetService("MarketplaceService")
02local Players = game:GetService("Players")
03game.Players.PlayerAdded:Connect(function(plr)
04    local success, message = pcall(function()
05        local haspass = false
06        local gamepassID = 9794050
07        haspass = MarketPlaceService:UserOwnsGamePassAsync(plr.UserId, gamepassID)
08        local toolclone = game.ServerStorage.GravityCoil:Clone()
09            toolclone.Parent = plr.Backpack
10            game.Workspace:WaitForChild(plr.Name):WaitForChild("Humanoid").Died:Connect(function() -- They've already loaded and won't get their StarterGear until next spawn
11                wait()
12                local toolclone1 = game.ServerStorage.GravityCoil:Clone()
13                toolclone1.Parent = plr.Backpack
14                print(toolclone.Parent)
15            end)
16        end
17    end)   
18end)

so in this code at line 16 it has an error it says expected ) to close ( at line 4 got end

0
Try removing the first end statement and move the bracket to the next line. radiant_Light203 1166 — 4y

2 answers

Log in to vote
1
Answered by 4 years ago

Remove the end that doesn't have the parenthesis

Ad
Log in to vote
1
Answered by 4 years ago

ok guys i did it

01local MarketPlaceService = game:GetService("MarketplaceService")
02local Players = game:GetService("Players")
03game.Players.PlayerAdded:Connect(function(plr)
04    local success, message = pcall(function()
05        local haspass = false
06        local gamepassId = 9794050
07        haspass = MarketPlaceService:UserOwnsGamePassAsync(plr.UserId, gamepassId)
08            local toolclone = game.ServerStorage.GravityCoil:Clone()
09            toolclone.Parent = plr.Backpack
10            while true do
11                local tool = plr.Backpack:FindFirstChild("GravityCoil"or plr.Character:FindFirstChild("GravityCoil")
12                if not tool then
13                    toolclone = game.ServerStorage.GravityCoil:Clone()
14                    toolclone.Parent = plr.Backpack
15                end
16                wait()
17            end
18    end)   
19end)

Answer this question