01 | local MarketPlaceService = game:GetService( "MarketplaceService" ) |
02 | local Players = game:GetService( "Players" ) |
03 | game.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 toolclone 1 = game.ServerStorage.GravityCoil:Clone() |
13 | toolclone 1. Parent = plr.Backpack |
14 | print (toolclone.Parent) |
15 | end ) |
16 | end |
17 | end ) |
18 | end ) |
so in this code at line 16 it has an error it says expected ) to close ( at line 4 got end
ok guys i did it
01 | local MarketPlaceService = game:GetService( "MarketplaceService" ) |
02 | local Players = game:GetService( "Players" ) |
03 | game.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 ) |
19 | end ) |