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

How to I make a hat in my character in Studio?

Asked by 4 years ago

I scripted it on my own and it didn't work. Script:

local button = script.Parent
button.MouseButton1Click:Connect(function()
local visor = Instance.new("Accessory", game.Players.LocalPlayer.Character.Head)
visor.Name = "ROBLOX2009Visor"
visor.AttachmentForward = "0,0,-1"
visor.AttachmentPos = "0,0.09,0.18"
visor.AttachmentRight = "0,1,0"
visor.AttachmentUp = "0,1,0"
visor.Archivable = true
local handle = Instance.new("Part", visor)
handle.Name = "Handle"
handle.Position = "0,6,0"
handle.Locked = true
handle.Archivable = true
handle.BackSurface = "Smooth"
handle.BottomSurface = "Smooth"
handle.FrontSurface = "Smooth"
handle.LeftSurface = "Smooth"
handle.RightSurface = "Smooth"
handle.TopSurface = "Smooth"
handle.BackParamA = "-0.5"
handle.BackParamB = "0.5"
handle.BackSurfaceInput = "NoInput"
handle.BottomParamA = "-0.5"
handle.BottomParamB = "0.5"
handle.BottomSurfaceInput = "NoInput"   
handle.FrontParamA = "-0.5"
handle.FrontParamB = "0.5"
handle.FrontSurfaceInput = "NoInput"    
handle.LeftParamA = "-0.5"
handle.LeftParamB = "0.5"
handle.LeftSurfaceInput = "NoInput" 
handle.RightParamA = "-0.5"
handle.RightParamB = "0.5"
handle.RightSurfaceInput = "NoInput"    
handle.TopParamA = "-0.5"
handle.TopParamB = "0.5"
handle.TopSurfaceInput = "NoInput"  
handle.CustomPhysicalProperties = false
handle.RootPriority = 0
handle.Shape = "Block"
handle.CollisionGroupId = 0
handle.Massless = false
handle.Anchored = false
handle.Orientation = "0,-8.01,0"
handle.BrickColor = BrickColor.new("Medium stone grey")
handle.CastShadow = true
local hatattachment = Instance.new("Attachment", handle)
hatattachment.Visible = false
hatattachment.Orientation = "0,-0,-0"
hatattachment.Position = "0,0.19,0.18"
hatattachment.Axis = "1,-0,-0"
hatattachment.SecondaryAxis = "0,1,0"
hatattachment.WorldAxis = "0.99, 0, 0.139"
hatattachment.WorldOrientation = "0.003, -8.009, 0.003"
hatattachment.WorldPosition = "0.025, 6.19, 0.178"
hatattachment.WorldSecondaryAxis = "-0,1,0"
hatattachment.Archivable = true
local mesh = Instance.new("SpecialMesh", handle)
mesh.MeshId = "http://www.roblox.com/asset/?id=1081088"
mesh.MeshType = "FileMesh"
mesh.Name = "Mesh"
mesh.Offset = "0,0,0"
mesh.Scale = "1.02,1.02,1.02"
mesh.TextureId = "http://www.roblox.com/asset/?id=7135943"
mesh.VertexColor = "1,1,1"
local weld1 = Instance.new("Weld", handle)
weld1.Name = "AccessoryWeld"
weld1.Part0 = handle
weld1.Part1 = game.Players.LocalPlayer.Character.Head
weld1.Active = false
weld1.Archivable = true
local weld2 = Instance.new("Weld", handle)
weld2.Name = "AccessoryWeld"
weld2.Part0 = handle
weld2.Part1 = game.Players.LocalPlayer.Character.Head
weld2.Active = false
weld2.Archivable = true
end)
0
In line 12, vector3 isnt used. Try doing handle.Position = Vector3.new(0,6,0) BiIinear 104 — 4y

Answer this question