Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

end statements are having an error?

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

1 comment

0

Try removing the first end statement and move the bracket to the next line.

2 answers

✓ Accepted answer

Remove the end that doesn't have the parenthesis

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.