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

How do I make instance.new FE using a local script?

Asked by 3 years ago

i tried it but doesnt work

local hat = Instance.new("Part")
hat.Parent = game.Players.LocalPlayer.Character.Head
hat.Anchored = true
hat.CanCollide = false
hat.Size = Vector3.new(1.85,1.6,2)
hat.Transparency = 0.35
hat.Name = "Anti-Skid Hat"
hat.TopSurface = "Smooth"
hat.RightSurface = "Smooth"
hat.LeftSurface = "Smooth"
hat.BottomSurface = "Smooth"
local mesh = Instance.new("SpecialMesh")
mesh.Parent = hat
mesh.MeshType = "Head"
mesh.Scale = Vector3.new(1,1,1)
mesh.Offset = Vector3.new(0,0,0)

game:service'RunService'.Heartbeat:Connect(function()
    hat.CFrame = game.Players.LocalPlayer.Character.Head.CFrame * CFrame.new(Vector3.new(0,0.15,0))
end)

i even set the parent to workspace

Answer this question