Twistir
|
  |
| Joined: 19 Nov 2009 |
| Total Posts: 12374 |
|
|
| 10 Feb 2015 09:14 AM |
This is in a local script to get a hat from the catalog and place it into the players character. The asset loads but then is not parented to player, but rather workspace. What's wrong?
repeat wait() until script.Parent.Parent.ClassName == "ScrollingFrame" texture = script.Parent.Texture.Value player = game.Players.LocalPlayer script.Parent.MouseButton1Down:connect(function(wear) local ser = game:GetService("InsertService") ser:LoadAsset(texture).Parent = player.Character end) |
|
|
| Report Abuse |
|
|
|
| 10 Feb 2015 09:35 AM |
I don't think you can use InsertService in a LocalScript, can you? Idk, it doesn't sound like Roblox, but it IS an old function.
Also, you should put the the "local ser = .." at the top, since I can't think of a reason to assign a variable each time. |
|
|
| Report Abuse |
|
|
Twistir
|
  |
| Joined: 19 Nov 2009 |
| Total Posts: 12374 |
|
|
| 10 Feb 2015 05:47 PM |
| I don't think that matters |
|
|
| Report Abuse |
|
|
Twistir
|
  |
| Joined: 19 Nov 2009 |
| Total Posts: 12374 |
|
| |
|
compy111
|
  |
| Joined: 02 Apr 2009 |
| Total Posts: 583 |
|
|
| 10 Feb 2015 06:11 PM |
When inserting a model on the client (via a Local Script), the model must also have been created by the place creator or by ROBLOX. If your game needs to insert an asset in a Local Script, use a RemoteEvent or RemoteFunction.
Source: http://wiki.roblox.com/index.php?title=Insertservice#Notes |
|
|
| Report Abuse |
|
|
Twistir
|
  |
| Joined: 19 Nov 2009 |
| Total Posts: 12374 |
|
|
| 10 Feb 2015 06:21 PM |
Yep I just figured that out, thanks though.
When you insert something it comes in a model, so I had to take out the hat, clone it to the player, and then delete the model. :) |
|
|
| Report Abuse |
|
|