I am wondering how I would get this to work. The script will delete a BUY NOW button if the user already owns the Gamepass connected to it.
1 | local passid = 162695807 -- The ID of the gamepass goes here |
2 | local tools = { "Duck Bike" } -- Here you just put the name(s) of the tool(s) you want given. (Tools must be put in the lighting) |
3 | local GamePassService = Game:GetService( 'GamePassService' ) |
4 | game.Players.PlayerAdded:connect( function (player) |
5 | if GamePassService:PlayerHasPass(player, passid) then |
6 | script.Parent:remove() |
7 | end |
8 | end ) |
This is what I have so far, but the chances of it working are very, very slim!
01 | passid = 162695807 |
02 | tools = { "Duck Bike" } |
03 |
04 | local GamePassService = game:GetService( "GamePassService" ) |
05 | function respawned(char) |
06 | local player = game.Players:FindFirstChild(char.Name) |
07 |
08 | if char:FindFirstChild( "Head" ) ~ = nil then |
09 | wait ( 0.01 ) |
10 | if GamePassService:PlayerHasPass(player, passid) then |
11 | script.Parent:remove() |
12 | else |
13 |
14 | end |
15 | end |
16 | end |
17 | game.Workspace.ChildAdded:connect(respawned) |