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: Hat remover script?

Previous Thread :: Next Thread 
DutLer22 is not online. DutLer22
Joined: 29 May 2016
Total Posts: 84
19 Jan 2017 05:01 AM
i have a hat remover script and it works but it only works for the hats u have on ur character. and i have some models with the hat giver script. and the hat remover script won't work on those models with hat giver script so i am stuck with a hat remover that only takes off the hats that u already are wearing plz help
Report Abuse
nooneisback is not online. nooneisback
Joined: 28 Feb 2012
Total Posts: 1672
19 Jan 2017 05:16 AM
Those hats are probably just welded meshes.

Remover.Touched:connect(function(Part)
local Plyr = game.Players:GetPlayerFromCharacter(Part.Parent)
if Plyr then
for i,v in next, Plyr.Head:GetChildren()do
if v:IsA("JointInstance")then
v.Part0:Destroy()
v:Destroy()
end
end
end
end)
Report Abuse
nooneisback is not online. nooneisback
Joined: 28 Feb 2012
Total Posts: 1672
19 Jan 2017 05:17 AM
Oops

v.Part1:Destroy()
Report Abuse
DutLer22 is not online. DutLer22
Joined: 29 May 2016
Total Posts: 84
19 Jan 2017 05:27 AM
ok let me try
Report Abuse
DutLer22 is not online. DutLer22
Joined: 29 May 2016
Total Posts: 84
19 Jan 2017 05:32 AM
where do i put that script?
Report Abuse
nooneisback is not online. nooneisback
Joined: 28 Feb 2012
Total Posts: 1672
19 Jan 2017 05:35 AM
Into the part which you step on if you want to remove the hats.
Just add

Remover = script.Parent
at the beginning.
But you should combine it with a real hat remover.
Report Abuse
DutLer22 is not online. DutLer22
Joined: 29 May 2016
Total Posts: 84
19 Jan 2017 05:37 AM
this is the script i have right now for the hat remover. is it real?

Remover = script.Parent
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)
Report Abuse
DutLer22 is not online. DutLer22
Joined: 29 May 2016
Total Posts: 84
19 Jan 2017 05:40 AM
oh wait thanks for help! i just found out that the hats were 'hat' instead of 'accessory'
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