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 » Scripting Helpers
Home Search
 

Re: How would I make a players hats turn invisible?

Previous Thread :: Next Thread 
paracord132 is not online. paracord132
Joined: 05 Jul 2012
Total Posts: 1321
19 Nov 2013 07:57 AM
K so the title explains it all any help?
Report Abuse
BenBonez is not online. BenBonez
Joined: 29 Aug 2008
Total Posts: 19362
19 Nov 2013 08:03 AM
Worn hats are located inside the Character as a Hat object.
Inside the Hat object you should find a part called "Handle" which if you change it's Transparency property will give you the desired result.
Report Abuse
paracord132 is not online. paracord132
Joined: 05 Jul 2012
Total Posts: 1321
19 Nov 2013 08:09 AM
Hello ben, So would I do player.Character or nope?
Report Abuse
DragonODeath is not online. DragonODeath
Joined: 02 May 2011
Total Posts: 1252
19 Nov 2013 08:10 AM
It's your choice. You could define it from workspace.

2 ways.
--first one
workspace.CHARACTERNAME.Hat.Handle.Transparency = 1
--second one
game.Players.PLRNAME.Character.Hat.Handle.Transparency = 1
Report Abuse
Scriptural is not online. Scriptural
Joined: 06 Sep 2013
Total Posts: 2979
19 Nov 2013 10:33 AM
Or you can use the working way
for Index, Object in pairs (Game.Players.Player.Character:GetChildren()) do
pcall(function()
Object.Handle.Transparency = 1
end)
end
Report Abuse
breuning is not online. breuning
Joined: 30 Oct 2008
Total Posts: 4268
19 Nov 2013 10:41 AM
and that will also turn all your equipped tool fully/partly invisible :D
Report Abuse
Scriptural is not online. Scriptural
Joined: 06 Sep 2013
Total Posts: 2979
19 Nov 2013 10:51 AM
I see no problem with that because the only reason to turn the hats invisible is for a invisibility tool but ok
pcall(function()
if not Object:IsA("Tool") then
Object.Handle.Transparency = 1
end
end)
Report Abuse
Scriptman8 is not online. Scriptman8
Joined: 25 Dec 2011
Total Posts: 5561
19 Nov 2013 10:57 AM
game.PlayerAdded:connect(plr)
game.Character:connect(chr)
for k,v in pairs(chr:children()) do
if v:IsA("Hat") then
v.Handle:remove()
end
end
end)
end)


This will remove hats when a play enter the game.
Report Abuse
Scriptman8 is not online. Scriptman8
Joined: 25 Dec 2011
Total Posts: 5561
19 Nov 2013 11:02 AM
game.PlayerAdded:connect(plr)
plr.CharacterAdded:connect(chr)
for k,v in pairs(chr:children()) do
if v:IsA("Hat") then
v.Handle:remove()
end
end
end)
end)

fix
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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