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
 

Previous Thread :: Next Thread 
erniec0105 is not online. erniec0105
Joined: 17 May 2009
Total Posts: 1742
09 Jul 2016 01:31 AM
How do you make it so that when a gamepass is bought; it gives the buyer a gear (Gear that is custom made and saved as a model, not Roblox made in the catalog)?
Report Abuse
seanbenish is not online. seanbenish
Joined: 31 Jul 2009
Total Posts: 429
09 Jul 2016 01:48 AM
If it is in game:

local c = obj:Clone()
c.Parent = player.Backpack

If it is not:

local stuff = {item_name = game:GetSerive("LoadService"):LoadAsset(asset_id)}
--i like to this method, as it does a bulk call at the start, and saves them as ghosts

--other code, until the part where you need to clone
local c = s[item_name]:Clone() --in this case, set item_name to a key for s
c.Parent = player.Backpacka


[Insert C++ statement here, b/c roblox doesn't allow it oVo]
Report Abuse
erniec0105 is not online. erniec0105
Joined: 17 May 2009
Total Posts: 1742
09 Jul 2016 02:08 AM
This works for saved models right?

Where do I even insert this.

Help.
Report Abuse
Seranok is not online. Seranok
Joined: 12 Dec 2009
Total Posts: 11083
09 Jul 2016 02:14 AM
I wrote a tutorial on this a while back: http://wiki.roblox.com/index.php?title=How_to_earn_R$_from_your_game
Report Abuse
DarthStrantax is not online. DarthStrantax
Joined: 31 May 2011
Total Posts: 2610
09 Jul 2016 02:16 AM
hi senarok
Report Abuse
erniec0105 is not online. erniec0105
Joined: 17 May 2009
Total Posts: 1742
09 Jul 2016 02:26 AM
Thank you, Seranok.
Report Abuse
erniec0105 is not online. erniec0105
Joined: 17 May 2009
Total Posts: 1742
09 Jul 2016 02:57 AM
I've run into a problem.

Say if I wanted to insert https://www.roblox.com/Trench-Raiding-Club-item?id=449898743 instead of the sword; what do I modify?
Report Abuse
seanbenish is not online. seanbenish
Joined: 31 Jul 2009
Total Posts: 429
09 Jul 2016 03:01 AM
Replace the object with this:
game:GetSerivce("LoadService"):LoadAsset(449898743)
This will load that asset and you can set it to a variable for further modification.


[Insert C++ statement here, b/c roblox doesn't allow it oVo]
Report Abuse
erniec0105 is not online. erniec0105
Joined: 17 May 2009
Total Posts: 1742
09 Jul 2016 03:03 AM
Do I have to put it into server storage first?
Report Abuse
seanbenish is not online. seanbenish
Joined: 31 Jul 2009
Total Posts: 429
09 Jul 2016 03:10 AM
Maybe, it all depends on how you want to manage that object.

The most basic is a one-time use, as it will load the object and will not create a backup. Do this for thing that probably will not be removed frequently.

Now, there are two ways to create a backup
1. Instance ghosting
Although not very common, the use of instance ghosting can be used as a way to backup data. An "instance ghost" is an instance (aka: an object) that has no parent. This means that it's data is only supported by the script it runs, and once that ends, the data is wiped. You can use this to create a table of preloaded instances that you can use another function to clone from.

2. Storing
As the name suggests, this will store the object somewhere,usually either in serverstorage or replicatedstorage(but be careful about what you give to the client). Although this will allow for other scripts to interact with it (w/o using events), it is susceptible to deletion, so make sure you do not delete the main copy.


[Insert C++ statement here, b/c roblox doesn't allow it oVo]
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