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 to get a hat?

Previous Thread :: Next Thread 
Kepie is not online. Kepie
Joined: 12 Nov 2011
Total Posts: 884
17 May 2012 03:18 PM
How to make a hat (And it also is on your head),

So to tell this very simple: what is the hat function?
Report Abuse
Kepie is not online. Kepie
Joined: 12 Nov 2011
Total Posts: 884
17 May 2012 03:19 PM
Goes it like this on the start:

hat = Instance.new("Hat",Players.Kepie.Head)



??
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
17 May 2012 03:29 PM
No. Head is not a valid member. You would say

hat = Instance.new("Hat",Players.Kepie.Character.Head)

Then get the mesh and part, and yeah.
Report Abuse
Kepie is not online. Kepie
Joined: 12 Nov 2011
Total Posts: 884
17 May 2012 03:52 PM
Goes, the mesh like this:

hat = Instance.new("SpecialMesh")
hat.Parent = hat
hat.MeshType = "FileMesh"
hat.MeshId = "http://www.roblox.com/asset/?id=19251107"
hat.Scale = Vector3.new(0.27,1,0.27)

and where should the part function be place?
Report Abuse
Kepie is not online. Kepie
Joined: 12 Nov 2011
Total Posts: 884
17 May 2012 03:55 PM
Can you just say the script, because i dont know how i should type the brick when its a hat an where, and problem with the mesh.
Report Abuse
Kepie is not online. Kepie
Joined: 12 Nov 2011
Total Posts: 884
17 May 2012 03:56 PM
I want to learn by looking at scripts, it makes things much easier then someone explaining.
Report Abuse
Kepie is not online. Kepie
Joined: 12 Nov 2011
Total Posts: 884
17 May 2012 04:07 PM
bump
Report Abuse
Kepie is not online. Kepie
Joined: 12 Nov 2011
Total Posts: 884
17 May 2012 04:22 PM
bump
Report Abuse
bluepen16 is not online. bluepen16
Joined: 13 Nov 2008
Total Posts: 1870
17 May 2012 04:45 PM
hat = Instance.new("SpecialMesh")
hat.Parent = hat
hat.MeshType = "FileMesh"
hat.MeshId = "http://www.roblox.com/asset/?id=19251107"
hat.Scale = Vector3.new(0.27,1,0.27)

^ You labled the hat as a value already, you need to name it "hat1" or a different one.
Report Abuse
Kepie is not online. Kepie
Joined: 12 Nov 2011
Total Posts: 884
18 May 2012 03:12 AM
thx.
Report Abuse
Kepie is not online. Kepie
Joined: 12 Nov 2011
Total Posts: 884
18 May 2012 03:17 AM
hat1 = Instance.new("Hat",Players.Kepie.Character.Head)
hat1 = Instance.new("SpecialMesh")
hat1.Parent = hat1
hat1.MeshType = "FileMesh"
hat1.MeshId = "http://www.roblox.com/asset/?id=19251107"
hat1.Scale = Vector3.new(0.27,1,0.27)

Is this the hat script?
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
18 May 2012 03:27 AM
hat = Instance.new("Hat",Players.Kepie.Character.Head)
hat1 = Instance.new("SpecialMesh")
hat1.Parent = hat
hat1.MeshType = "FileMesh"
hat1.MeshId = "http://www.roblox.com/asset/?id=19251107"
hat1.Scale = Vector3.new(0.27,1,0.27)

That one is right.
Report Abuse
Kepie is not online. Kepie
Joined: 12 Nov 2011
Total Posts: 884
18 May 2012 03:35 AM
But why is the first word "hat" and not "hat1"?
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
18 May 2012 03:38 AM
hat = Instance.new("Hat",Players.Kepie.Character.Head) --This line creates the hat (looks like a brick) that is named "hat" inside the script
hat1 = Instance.new("SpecialMesh") --This here creates the mesh for the hat so it is not the same and needs another name
hat1.Parent = hat --To place the mesh inside the hat, you must do it like that. That's why you need two different names
hat1.MeshType = "FileMesh"
hat1.MeshId = "http://www.roblox.com/asset/?id=19251107"
hat1.Scale = Vector3.new(0.27,1,0.27)
Report Abuse
Kepie is not online. Kepie
Joined: 12 Nov 2011
Total Posts: 884
18 May 2012 03:42 AM
Ok, but i just wanted to ask why "hat" and not "hat1"

I still dont get it.
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
18 May 2012 03:43 AM
hat = Brick
hat1 = Mesh

If you would also name it hat1, than it would be the same like at the very beginning of this forum.
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
18 May 2012 03:44 AM
*thread
Report Abuse
Kepie is not online. Kepie
Joined: 12 Nov 2011
Total Posts: 884
18 May 2012 03:47 AM
So if the "hat" you said, and changed it to "hat1"

Then it would be invalid right? since the mesh name is already there, so i think i get it.
Report Abuse
Kepie is not online. Kepie
Joined: 12 Nov 2011
Total Posts: 884
18 May 2012 03:50 AM
Cheater, the script didnt work for some reason.
Report Abuse
Kepie is not online. Kepie
Joined: 12 Nov 2011
Total Posts: 884
18 May 2012 03:53 AM
This is what the output said:

10:52:39 - Workspace.Script:1: attempt to index global 'Players' (a nil value)
10:52:39 - Script "Workspace.Script", Line 1
10:52:39 - stack end
Report Abuse
Kepie is not online. Kepie
Joined: 12 Nov 2011
Total Posts: 884
18 May 2012 05:42 AM
bump
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
18 May 2012 06:09 AM
hat = Instance.new("Hat",game.Players.Kepie.Character.Head)
hat1 = Instance.new("SpecialMesh")
hat1.Parent = hat
hat1.MeshType = "FileMesh"
hat1.MeshId = "http://www.roblox.com/asset/?id=19251107"
hat1.Scale = Vector3.new(0.27,1,0.27)

Anyways, this won't work in a test server because there your name is "Player" and not "Kepie". Check it in Visit Online.
Report Abuse
Kepie is not online. Kepie
Joined: 12 Nov 2011
Total Posts: 884
18 May 2012 06:12 AM
I tested it on an SB (And dont think its anything wrong with it, i tested at my place and the SB, their the same)

So it didnt appear, nothing happend.
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
18 May 2012 06:16 AM
Euhm, just a tiny hint. You forgot to set all the hat's parts like position etc.
Look up a free hat giver and look what you've got to do there. There's some stuff you must add before it's your hat. Also a hat isn't placed in your head. It's in your character.

hat = Instance.new("Hat",game.Players.Kepie.Character)
hat1 = Instance.new("SpecialMesh")
hat1.Parent = hat
hat1.MeshType = "FileMesh"
hat1.MeshId = "http://www.roblox.com/asset/?id=19251107"
hat1.Scale = Vector3.new(0.27,1,0.27)
Report Abuse
Kepie is not online. Kepie
Joined: 12 Nov 2011
Total Posts: 884
18 May 2012 06:16 AM
Is there anything more i have to add in the hat script to get it work?
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