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
 

Loads an asset but doesn't parent it?

Previous Thread :: Next Thread 
Twistir is not online. 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
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
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 is not online. Twistir
Joined: 19 Nov 2009
Total Posts: 12374
10 Feb 2015 05:47 PM
I don't think that matters
Report Abuse
Twistir is not online. Twistir
Joined: 19 Nov 2009
Total Posts: 12374
10 Feb 2015 06:10 PM
someone please???
Report Abuse
compy111 is not online. 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 is not online. 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
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