|
| 28 Sep 2015 04:26 AM |
I am having trouble getting Inset Service to work. No output errors and nothing.
What I should be doing is getting a local script to access insert service and insert a model from my inventory into the backpack of the local player:
a = game:GetService("InsertService"):LoadAsset(300873417) a.Parent = game.Players.LocalPlayer:WaitForChild("Backpack")
OR
a.Parent = game.Players.LocalPlayer:FindFirstChild("Backpack")
none of them work :( |
|
|
| Report Abuse |
|
|
Froast
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 3134 |
|
|
| 28 Sep 2015 04:32 AM |
When you use InsertService to load an asset it puts it all into a model, if you don't extract it it might not work.
local backpack = game:GetService'Players'.LocalPlayer:WaitForChild'Backpack' for _,child in next, game:GetService'InsertService':LoadAsset(300873417) do child.Parent = backpack end
Or, if there's only one thing in your model:
game:GetService'InsertService':LoadAsset(300873417).Parent = game:GetService'Players'.LocalPlayer:WaitForChild'Backpack' |
|
|
| Report Abuse |
|
|
|
| 28 Sep 2015 05:18 AM |
| I tried, the second one since its a gun but it doesn't work. No errors but somehow is not working in my place |
|
|
| Report Abuse |
|
|
|
| 28 Sep 2015 05:26 AM |
| its in a model in backpack. Do you know how to extract it? |
|
|
| Report Abuse |
|
|
Froast
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 3134 |
|
|
| 28 Sep 2015 05:27 AM |
| Sorry the second one was supposed to be game:GetService'InsertService':LoadAsset(300873417):GetChildren()[1].Parent = game:GetService'Players'.LocalPlayer:WaitForChild'Backpack' |
|
|
| Report Abuse |
|
|
| |
|
|
| 28 Sep 2015 05:57 AM |
| Ok now I need to insert multiple guns at once into the backpack but because of that [1] its conflicting, how do i modify it since the number of guns i insert is different each time and isn't a certain amount (e.g I'd probs choose to insert 5 guns into my backpack if i press a gui button) |
|
|
| Report Abuse |
|
|
Froast
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 3134 |
|
|
| 28 Sep 2015 06:00 AM |
If you mean inserting all the objects in one model then use the first one (which I also made a mistake on). Fixed here:
local backpack = game:GetService'Players'.LocalPlayer:WaitForChild'Backpack' for _,child in next, game:GetService'InsertService':LoadAsset(300873417):GetChildren() do child.Parent = backpack end |
|
|
| Report Abuse |
|
|
|
| 28 Sep 2015 06:06 AM |
Nope, What it does is that it only inserts one model into my backpack when I want it to insert 2. So I mean, if I have 2 or more models I want to insert at once, I have to use 2 of the codes for example.
local backpack = game:GetService'Players'.LocalPlayer:WaitForChild'Backpack' for _,child in next, game:GetService'InsertService':LoadAsset(300873417):GetChildren() do child.Parent = backpack end
local backpack = game:GetService'Players'.LocalPlayer:WaitForChild'Backpack' for _,child in next, game:GetService'InsertService':LoadAsset(300873417):GetChildren() do child.Parent = backpack end
BUT Im only receiving one gun not two. |
|
|
| Report Abuse |
|
|
|
| 28 Sep 2015 06:37 AM |
| nvm im dumb did it wrong, works now |
|
|
| Report Abuse |
|
|