generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Adding custom gear to gamepass?

Previous Thread :: Next Thread 
PinkyMousey is not online. PinkyMousey
Joined: 14 Apr 2013
Total Posts: 106
06 Feb 2017 05:25 PM
Hi, I need some help. I'm trying to build a game pass that gives people tea and a bowl of rice when they join the game. Only thing is, I can't figure out how. I know how to do it with regular gear from the catalog, but I cannot figure out how to do a custom gear?
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
06 Feb 2017 05:29 PM
local rice = 12341234 -- rice gamepass ID
local tea = 12341234 -- tea gamepass ID
local ms = ame:GetService("MarketplaceService")

game.Players.PlayerAdded:connect(function(player)
if ms:PlayerOwnsAsset(player,rice) then
game.ServerStorage:FindFirstChild("RiceTool"):Clone().Parent = player.StarterGear
game.ServerStorage:FindFirstChild("RiceTool"):Clone().Parent = player.Backpack
end
if ms:PlayerOwnsAsset(player,tea) then
game.ServerStorage:FindFirstChild("TeaTool"):Clone().Parent = player.StarterGear
game.ServerStorage:FindFirstChild("TeaTool"):Clone().Parent = player.Backpack
end
end)

-- Probably a way to optimize this redundancy, however, you'll need to put it in both the player's startergear and backpack so that they get it on subsequent respawns


Report Abuse
PinkyMousey is not online. PinkyMousey
Joined: 14 Apr 2013
Total Posts: 106
06 Feb 2017 05:34 PM
Alright, thank you very much.
Report Abuse
PinkyMousey is not online. PinkyMousey
Joined: 14 Apr 2013
Total Posts: 106
06 Feb 2017 05:39 PM
One more question, the gear I'm using (they're models), I don't have a gear id for them. So what do I do?
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
06 Feb 2017 05:41 PM
Those would be the gamepass IDs, not the gear IDs
Just put the tools in the ServerStorage


Report Abuse
PinkyMousey is not online. PinkyMousey
Joined: 14 Apr 2013
Total Posts: 106
06 Feb 2017 05:45 PM
Alright so I put the gear in server storage, and now all I have to do is put the gamepass id into the script? How will it know I want THOSE tools???
Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
06 Feb 2017 05:46 PM
'game.ServerStorage:FindFirstChild("RiceTool")'
..
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
06 Feb 2017 05:47 PM
Because I named them RiceTool and TeaTool, which you should name your tools accordingly, and then put them in the ServerScriptService.

If you need to insert them into your game first, use this:
http://wiki.roblox.com/index.php?title=API:Class/InsertService/LoadAsset


Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
06 Feb 2017 05:47 PM
Do away with FindFirstChild if it triggers you because it's unnecessary but was just as easy to copypasta


Report Abuse
PinkyMousey is not online. PinkyMousey
Joined: 14 Apr 2013
Total Posts: 106
06 Feb 2017 05:55 PM
Darnit. I cannot seem to make it work!! I put the 2 items in service storage, and sever script service. Is it possible that you could make a script with the gamepass, tea, and rice id and then turn it into a model and send it to me? I know its a lot to ask but none of this is working for me >.<

This is the gamepass: https://www.roblox.com/library/643885738/Tea-and-a-bowl-of-rice

The rice is at: https://www.roblox.com/library/274906395/Bowl-of-Rice

The tea is at: https://www.roblox.com/library/164620253/Tea
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image