|
| 26 Oct 2012 06:34 PM |
I've tried to fix this several times but I haven't figured it out. Can anyone help?
function onClicked() local model = game:GetService("InsertService"):LoadAsset(13844618) if(model:IsA("Hat")) then local tab = game:GetService("InsertService"):Insert(model) model.Parent = script.Parent.Parent.Parent["Profile Character"].Appearance end end
function MouseOver() script.Parent.Parent.MouseOverText.Text = script.Parent.Name end
script.Parent.MouseButton1Click:connect(onClicked) script.Parent.MouseEnter:connect(MouseOver) |
|
|
| Report Abuse |
|
|
|
| 26 Oct 2012 06:37 PM |
I haven't worked with InsertService much (I very much dislike it), but this is my (probably wrong) theory, try it out.
When you insert something with InsertSerivce using LoadAsset it gives you a model, not the object. This means that you're checking if a model is a hat in line 3. Try this:
if model:GetChildren()[1]:IsA("Hat") then |
|
|
| Report Abuse |
|
|
|
| 26 Oct 2012 06:39 PM |
| I was trying to load a hat from the catalog. I'll try that. I used to dislike InsertService before I realized that it has a few places in my game that it would improve. |
|
|
| Report Abuse |
|
|