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 3 years ago
local MarketPlaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
game.Players.PlayerAdded:Connect(function(plr)
    local success, message = pcall(function()
        local haspass = false
        local gamepassID = 9794050
        haspass = MarketPlaceService:UserOwnsGamePassAsync(plr.UserId, gamepassID)
        local toolclone = game.ServerStorage.GravityCoil:Clone()
            toolclone.Parent = plr.Backpack
            game.Workspace:WaitForChild(plr.Name):WaitForChild("Humanoid").Died:Connect(function() -- They've already loaded and won't get their StarterGear until next spawn
                wait()
                local toolclone1 = game.ServerStorage.GravityCoil:Clone()
                toolclone1.Parent = plr.Backpack
                print(toolclone.Parent)
            end)
        end
    end)    
end)

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 — 3y

2 answers

Log in to vote
1
Answered by 3 years ago

Remove the end that doesn't have the parenthesis

Ad
Log in to vote
1
Answered by 3 years ago

ok guys i did it

local MarketPlaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
game.Players.PlayerAdded:Connect(function(plr)
    local success, message = pcall(function()
        local haspass = false
        local gamepassId = 9794050
        haspass = MarketPlaceService:UserOwnsGamePassAsync(plr.UserId, gamepassId)
            local toolclone = game.ServerStorage.GravityCoil:Clone()
            toolclone.Parent = plr.Backpack
            while true do
                local tool = plr.Backpack:FindFirstChild("GravityCoil")  or plr.Character:FindFirstChild("GravityCoil")
                if not tool then
                    toolclone = game.ServerStorage.GravityCoil:Clone()
                    toolclone.Parent = plr.Backpack
                end
                wait()
            end
    end)    
end)

Answer this question