VRYLLION
|
  |
| Joined: 22 Dec 2014 |
| Total Posts: 191 |
|
|
| 28 Mar 2017 12:06 AM |
This is a localscript with filtering enabled true. The following does "work", meaning the hat is put inside of the player's character. But the character doesn't wear it. Assume the locations I reference in the code exist and that the hat does weld properly.
repeat wait() until game.Players.LocalPlayer
you = game.Players.LocalPlayer.Character script.Parent.MouseButton1Down:connect(function() if you ~= nil then local char = you:GetChildren() for i =1, #char do if char[i].Name == "Helmet" then char[i]:remove() end end local tot = game.Lighting.Helmets.Bolts:GetChildren() for i =1, #tot do if tot[i].Name == script.Parent.Name then local get = tot[i]:clone() get.Parent = you get.Name = "Helmet" end end end end) |
|
|
| Report Abuse |
|
|
|
| 28 Mar 2017 12:07 AM |
wiki.roblox.com/index.php?title=API:Class/Humanoid/AddAccessory
|
|
|
| Report Abuse |
|
|
VRYLLION
|
  |
| Joined: 22 Dec 2014 |
| Total Posts: 191 |
|
|
| 28 Mar 2017 12:10 AM |
| That shouldn't really make a difference. I still have old hat objects that can be worn just fine. Although I already tried it as an accessory, same result. |
|
|
| Report Abuse |
|
|
| |
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 28 Mar 2017 01:08 AM |
Use remote events and store the hat in server storage. Don't store anything in lighting.
|
|
|
| Report Abuse |
|
|