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)
✓ ANSWER ACCEPTED
Line 15 the end is underlined red ,why?
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.

1 comment
You have an
end)on line 4. lol