|
| 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 |
|
|
|
| 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 |
|
|
|
| 09 Jul 2016 02:08 AM |
This works for saved models right?
Where do I even insert this.
Help. |
|
|
| Report Abuse |
|
|
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 |
|
|
| |
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 09 Jul 2016 03:03 AM |
| Do I have to put it into server storage first? |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|