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

Line 15 the end is underlined red ,why?


local gamepass = script:WaitForChild("GamePassid")
local service = game:GetService("GamePassService")

game.Players.PlayerAdded:connect(function(player)end)
 if service:PlayerHasPass(player,gamepass.Value)then
   local tools = game.ReplicatedStorage:WaitForChild("Tools") 
 for i,v in pairs(tools:getChildren())do
  if v:isA("Tool")then
   v:Clone().Parent = player:WaitForChild("Backpack")
v:Clone().Parent = player:WaitForChild("StarterGear")
   end
  end
 end
end)

1 comment

2

You have an end) on line 4. lol

1 answer

✓ Accepted answer

I believe you need to remove the GamePassService and replace it with the MarketPlaceService?

 local allow = (
        game:GetService('MarketplaceService'):UserOwnsGamePassAsync(player.userId, 1234567) -- GP id here
    )
 
    if allow then -- continue with script

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