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: How do you make a player have a custom hat on their head?

Previous Thread :: Next Thread 
Serkisx is not online. Serkisx
Joined: 25 May 2014
Total Posts: 4270
13 Feb 2016 08:09 AM
How do you make a player have a custom hat on their head?

How do I do it? Please help me... I know how to do it with pants and shirt.

Google is a magical place my friend.
Report Abuse
Smeers is not online. Smeers
Joined: 14 Feb 2013
Total Posts: 797
13 Feb 2016 08:13 AM
'Custom' hat?

As in you want a hat that you created on their head?

You would insert the Hat object (should have a Handle in it, that has a Mesh in it, which would be the hat) into the character. It wouldn't work if it was just lying around unanchored in the workspace.
Report Abuse
Serkisx is not online. Serkisx
Joined: 25 May 2014
Total Posts: 4270
13 Feb 2016 09:04 AM
I'm talking about a player, not a NPC/Dummy.

Google is a magical place my friend.
Report Abuse
wonderful72pike is not online. wonderful72pike
Joined: 13 Jul 2010
Total Posts: 7009
13 Feb 2016 09:08 AM
Smeers is right. If you name a part "Handle" and put it inside of a Hat object then it can be worn by the player. To force them to wear it you just directly parent it to the Character, it will work no matter how many hats they have on.
Report Abuse
Serkisx is not online. Serkisx
Joined: 25 May 2014
Total Posts: 4270
13 Feb 2016 09:12 AM
@wonderful

Do I need a script for that?

Google is a magical place my friend.
Report Abuse
thesecondcomingdoom is not online. thesecondcomingdoom
Joined: 09 Feb 2016
Total Posts: 1020
13 Feb 2016 09:13 AM
Yeah you need a script. example this

game.Workspace.MYHATyoudontknowlolel:clone().Parent = game.Players.LocalPlayer.Character
Report Abuse
Serkisx is not online. Serkisx
Joined: 25 May 2014
Total Posts: 4270
13 Feb 2016 09:27 AM
I got it work, but now if I reset, I don't have it on anymore.

Google is a magical place my friend.
Report Abuse
wonderful72pike is not online. wonderful72pike
Joined: 13 Jul 2010
Total Posts: 7009
13 Feb 2016 09:34 AM
So you have to add it every time they spawn. Since it is a custom hat it can't be auto-loaded from the website.
Report Abuse
Csharp0 is not online. Csharp0
Joined: 05 Mar 2015
Total Posts: 261
13 Feb 2016 09:40 AM
Your siggy is very ironic, Serk. lmao
Report Abuse
Serkisx is not online. Serkisx
Joined: 25 May 2014
Total Posts: 4270
13 Feb 2016 09:42 AM
Is there no other way to do it?

Google is a magical place my friend.
Report Abuse
Serkisx is not online. Serkisx
Joined: 25 May 2014
Total Posts: 4270
13 Feb 2016 09:43 AM
@Csharp,

I just noticed, LOOL.

Google is a magical place my friend.
Report Abuse
indeimaus is not online. indeimaus
Joined: 01 Sep 2014
Total Posts: 4285
13 Feb 2016 09:56 AM
hat = where your hat is located

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
local hatClone = hat:Clone()
hatClone.Parent = character
end)
end)
Report Abuse
indeimaus is not online. indeimaus
Joined: 01 Sep 2014
Total Posts: 4285
13 Feb 2016 10:02 AM
and the hat can't be anchored or in serverstorage unless you clone it into the player's client(straight from serverstorage wont work)

this will work if the hat is in serverstorage and named "Hat"


game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
local realHat = game:GetService("ServerStorage").Hat:Clone()
realHat.Parent = game.ReplicatedStorage
local playerHat = realHat:Clone()
playerHat.Parent = character
realHat:Destroy()
end)
end)
Report Abuse
Serkisx is not online. Serkisx
Joined: 25 May 2014
Total Posts: 4270
13 Feb 2016 10:05 AM
@indei,
what do you mean where my hat is

Google is a magical place my friend.
Report Abuse
indeimaus is not online. indeimaus
Joined: 01 Sep 2014
Total Posts: 4285
13 Feb 2016 10:10 AM
I mean where ever you put that hat like if your hat is in the workspace then you type workspace:FindFirstChild("insert the hat's name here")
Report Abuse
TheGreenDeveloper is not online. TheGreenDeveloper
Joined: 29 Dec 2013
Total Posts: 776
13 Feb 2016 10:17 AM
if you are gonna try to script you might as well learn the basics of studio first :P
Report Abuse
Serkisx is not online. Serkisx
Joined: 25 May 2014
Total Posts: 4270
13 Feb 2016 10:19 AM
cant make it work ffs

Google is a magical place my friend.
Report Abuse
indeimaus is not online. indeimaus
Joined: 01 Sep 2014
Total Posts: 4285
13 Feb 2016 10:24 AM
gosh darn it ,you goof!

just use the first one I sent but replace "hat = where the hat is" with "hat = game.ReplicatedStorage.Hat" and make sure the hat's value "Name" is "Hat"
Report Abuse
indeimaus is not online. indeimaus
Joined: 01 Sep 2014
Total Posts: 4285
13 Feb 2016 10:25 AM
AND DON'T FORGET TO PUT THE HAT IN REPLICATED STORAGE
Report Abuse
thesecondcomingdoom is not online. thesecondcomingdoom
Joined: 09 Feb 2016
Total Posts: 1020
13 Feb 2016 10:33 AM
put this script into screengui

game.Workspace.MYHATyoudontknowlolel:clone().Parent = game.Players.LocalPlayer.Character
Report Abuse
Serkisx is not online. Serkisx
Joined: 25 May 2014
Total Posts: 4270
13 Feb 2016 10:42 AM
Nothing is working, fml.

Google is a magical place my friend.
Report Abuse
Serkisx is not online. Serkisx
Joined: 25 May 2014
Total Posts: 4270
13 Feb 2016 10:49 AM
What's wrong in this script?

hat = game.ReplicatedStorage.Hat

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
local realHat = game:GetService("ServerStorage").Hat:Clone()
realHat.Parent = game.ReplicatedStorage
local playerHat = realHat:Clone()
playerHat.Parent = character
realHat:Destroy()
end)
end)

Google is a magical place my friend.
Report Abuse
indeimaus is not online. indeimaus
Joined: 01 Sep 2014
Total Posts: 4285
13 Feb 2016 10:56 AM
THIS ONE IS ONLY USED IF "Hat" IS IN SERVERSTORAGE
At this point I'm not even sure you're a human. How do we know you're not an alien?!!!!
Report Abuse
Serkisx is not online. Serkisx
Joined: 25 May 2014
Total Posts: 4270
13 Feb 2016 10:57 AM
It is though. x'D

Google is a magical place my friend.
Report Abuse
indeimaus is not online. indeimaus
Joined: 01 Sep 2014
Total Posts: 4285
13 Feb 2016 11:07 AM
the script you're trying to use doesn't clone anything called "Hat" in replicated storage.
that script copies a hat from severstorage to replicated storage then the player and after all of that deletes the hat it cloned in replicated storage
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