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

How do I get this to rotate?

Asked by
ItsMeKlc 235 Moderation Voter
8 years ago

I'm trying to get this part to follow the player, so far all of it works except the part wont rotate, why? (this is inside a tool)

while true do
    wait()
    if script.Parent.Parent:FindFirstChild("HumanoidRootPart") then
    script.Parent.Part.CFrame = script.Parent.Parent:FindFirstChild("HumanoidRootPart").CFrame+script.Parent.Parent:FindFirstChild("HumanoidRootPart").CFrame.lookVector*5
    local rot = script.Parent.Parent:FindFirstChild("HumanoidRootPart").CFrame:toEulerAnglesXYZ()   
    script.Parent.Part.CFrame = CFrame.new(rot+math.floor(script.Parent.Part.CFrame.X),math.floor(script.Parent.Part.CFrame.Y),math.floor(script.Parent.Part.CFrame.Z))
    end
end

Answer this question