Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make a mesh hat spawn larger?

Asked by 8 years ago

Hey, I was just wondering if anyone knew how to make this code so not only does it spawn the hat onto the player, but it also spawns it slightly larger since currently it looks too small?

P.Size doesn't create the mesh larger, it remains the same size no matter the size I put in.

h = Instance.new("Hat")
p = Instance.new("Part")
p.Name = "Handle"
p.Size = Vector3.new(2,1,1)
m = Instance.new("SpecialMesh")
m.MeshType = "FileMesh"
m.MeshId = "http://www.roblox.com/Asset/?id="
m.TextureId = "http://www.roblox.com/asset/?id="
h.Parent = character
p.Parent = h
p.Position = character.Head.Position
m.Parent = p

w = Instance.new("Weld")
w.Parent = character.Head
w.Part1 = w.Parent
w.Part0 = p
w.C0 = CFrame.new(Vector3.new(0,-0.53,0))
0
Instead of using 'Size' property of the 'SpecialMesh', you have to use 'Scale' property. 'Scale' has 'Vector3' value type, just as 'Size'. For more information: http://wiki.roblox.com/index.php?title=API:Class/DataModelMesh/Scale http://wiki.roblox.com/index.php?title=API:Class/SpecialMesh LetThereBeCode 360 — 8y

2 answers

Log in to vote
0
Answered by 8 years ago

Don't change the part's size, change the mesh's scale value. To do this simply use:

m.Scale = Vector3.new(3,3,3) -- 3x the size.

In your case, use this script:

h = Instance.new("Hat")
p = Instance.new("Part")
p.Name = "Handle"
p.Size = Vector3.new(2,1,1)
m = Instance.new("SpecialMesh")
m.MeshType = "FileMesh"
m.MeshId = "http://www.roblox.com/Asset/?id="
m.TextureId = "http://www.roblox.com/asset/?id="
m.Scale = Vector3.new(2,2,2) -- Here's the scaling line!
h.Parent = character
p.Parent = h
p.Position = character.Head.Position
m.Parent = p

w = Instance.new("Weld")
w.Parent = character.Head
w.Part1 = w.Parent
w.Part0 = p
w.C0 = CFrame.new(Vector3.new(0,-0.53,0))

Use this if you need any extra information on the scale property.

If this worked for you or helped you, please vote up and accept this as the answer!

Ad
Log in to vote
0
Answered by
Pyracel 55
8 years ago

Or you could get the Model Resizer plugin.

Step 1 Open RStudio

Step 2 go to plugins

Step 3 find get plugins

Step 4 get the Model Resizer... P.S. For 2015 viewers its on the front page.

Step 5 find the mesh hat in the giver

Step 6 put it into workspace and grab yellow spheres and drag to preferred size ( they might not appear, if so restart rstudio)

Step 7 put the mesh hat back in place it was...

Step 8 say THANKS DUDEFUN and why is your name so weird and ur done yay xox have fun hope it works lol this is random xD happy halloween, but if ur reading this after halloween happy whatever holidays next thx byeee.

Answer this question