Answered by
5 years ago Edited 5 years ago
Ok... Lets try it!
First Step : First of all we need to know what is the "Market Place" service on Roblox API so we can get the Gamepass.
Link : [https://developer.roblox.com/en-us/api-reference/class/MarketplaceService]
Second Step : Second, we need to know how to access to a player that owns the Gamepass, but first we need the ID of the Gamepass. [You can get it by going to your gamepass page and looking for the URL, then you will see some numbers. That's the ID of your gamepass.]
4 | local mP = game:GetService( "MarketplaceService" ) |
That's how we acces to the Service and store the ID on a variable! So lets now fix your code!
Third Step : Enjoy coding! You always have to enjoy what are you doing! Play some music while you script or even play a game before to relax yourself.
Lets get into code
04 | local marketplace = game:GetService( "MarketplaceService" ) |
05 | local RS = game:GetService( "ReplicatedStorage" ) |
06 | local tool = RS:WaitForChild( "Tool" ) |
10 | game.Players.PlayerAdded:Connect( function (player) |
11 | if mp:UserOwnsGamePassAsync(player.UserId,Gid) then |
14 | local clone 1 = tool:Clone() |
15 | local clone 2 = tool:Clone() |
19 | local starterGear = player:WaitForChild( "StarterGear" ) |
20 | clone 1. Parent = player.Backpack |
21 | clone 2. Parent = starterGear |
24 | local warnMessage = "The code is incorrect!" |
That's how you fix it easealy. There's a bug so before you can't acces to the StarterGear like normaly we did it. So now is kinda fixed.
I hope my answer already solved your question. If its like that, please accept my answer. So you can let me know this helps you!
Note : The edit are for grammatical errors.
Keep scripting!