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
 

Re: all head item remover?

Previous Thread :: Next Thread 
Geargeez is not online. Geargeez
Joined: 28 Nov 2014
Total Posts: 842
22 Apr 2017 08:23 PM
idk how to make one like i need it to remove all accessories/hats on head


Report Abuse
Mister_Manakin is not online. Mister_Manakin
Joined: 16 Sep 2009
Total Posts: 1935
22 Apr 2017 08:33 PM
iterate through the children of the player character:

for _,item in pairs(player.Character:GetChildren()) do
if item:IsA("Accoutrement") then
item:Destroy()
end
end
Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
22 Apr 2017 08:35 PM
Humanoid:RemoveAccessories()


Report Abuse
Briicks is online. Briicks
Joined: 03 Apr 2015
Total Posts: 1796
22 Apr 2017 08:48 PM
WHAT!? When did that become a thing, "RemoveAccessories()"?

Report Abuse
TheCaptainTeach is online. TheCaptainTeach
Joined: 11 Jul 2015
Total Posts: 3846
22 Apr 2017 09:11 PM
^ a while ago.. lol. It replaced Hats:Remove()
Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
22 Apr 2017 09:12 PM
"It replaced Hats:Remove()"

...


Report Abuse
TheCaptainTeach is online. TheCaptainTeach
Joined: 11 Jul 2015
Total Posts: 3846
22 Apr 2017 09:14 PM
if v:IsA'Hat' then
v:Remove()

yah, i explained it bad
Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
22 Apr 2017 09:15 PM
You're implying that Remove wasn't deprecated before RemoveAccessories was added...


Report Abuse
TheCaptainTeach is online. TheCaptainTeach
Joined: 11 Jul 2015
Total Posts: 3846
22 Apr 2017 09:19 PM
God damn unsub, you dont let anything go, do you.

v:IsA'Hat' then
v:Destroy()

hapi e.e
Report Abuse
SunShiba is not online. SunShiba
Joined: 09 Mar 2014
Total Posts: 30030
22 Apr 2017 10:03 PM
Ya I was having trouble with that too

What I did was this:

Script 1:

function onTouched(hit)
local d = hit.Parent:GetChildren()
for i=1, #d do
if (d[i].className == "Accessory") then
d[i]:remove()
end
end
end

script.Parent.Touched:connect(onTouched)

Then I added a script 2 that is the same as Script 1 but instead of "Accessory" I did "Hat" for my game because there are things in my game that still classify as Hats
Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
22 Apr 2017 10:04 PM
SunShiba, how about actually reading the thread before posting? That's unnecessary and you're using a deprecated property and function.

The RemoveAccessories function exists.


Report Abuse
SunShiba is not online. SunShiba
Joined: 09 Mar 2014
Total Posts: 30030
22 Apr 2017 10:05 PM
Im trying to help and youre being rude
Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
22 Apr 2017 10:06 PM
Posting an overcomplicated solution and using deprecation is just misleading.


Report Abuse
SunShiba is not online. SunShiba
Joined: 09 Mar 2014
Total Posts: 30030
22 Apr 2017 10:08 PM
As long as it works then whats the problem...
Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
22 Apr 2017 10:08 PM
"As long as it works"

That's a terrible philosophy to go by when programming.


Report Abuse
SunShiba is not online. SunShiba
Joined: 09 Mar 2014
Total Posts: 30030
22 Apr 2017 10:16 PM
Well I just started getting into this 'scripting' thing about 2 weeks ago. Im just trying to offer help to someone
Report Abuse
Briicks is online. Briicks
Joined: 03 Apr 2015
Total Posts: 1796
22 Apr 2017 11:26 PM
Don't use ################### I tried it multi times and it didn't always remove everything, I was left with 1 hat on still almost everytime.
Report Abuse
Briicks is online. Briicks
Joined: 03 Apr 2015
Total Posts: 1796
22 Apr 2017 11:26 PM
RemoveAccessories()

Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
22 Apr 2017 11:28 PM
That's because the item wasn't converted to an accessory by ROBLOX yet. If it still happens then go ahead and loop, but there shouldn't be any items that are left over. If there are, I'd tell ROBLOX.


Report Abuse
Briicks is online. Briicks
Joined: 03 Apr 2015
Total Posts: 1796
22 Apr 2017 11:29 PM
Yes it is, I thought that myself and I checked the item.

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