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

Rotating a brick around your head?

Asked by 7 years ago

I want to make something like an Orb, but I want to rotate it around my head, which I don't know how to do. So far, I've welded it to my head, but I can't figure out how to rotate it.

Script:

script.Parent.Touched:connect(function(hit)
    local humanoid = hit.Parent:findFirstChild'Humanoid'
    if humanoid then
        local head = hit.Parent:findFirstChild'Head'
        script.Parent.CFrame = head.CFrame
        script.Parent.Anchored = false
        local weld = Instance.new('Weld')
        weld.Part0 = head
        weld.C0 = head.CFrame:inverse()
        weld.Part1 = script.Parent
        weld.C1 = script.Parent.CFrame:inverse()
        weld.Parent = script.Parent
    end
end)

Answer this question