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

Help with part rotation: script-wise?

Asked by 8 years ago

I am making a character morph script, and it involves a part being rotated around the head, but my code doesn't seem to rotate the part. Could someone check my script and see what's wrong with it?

    local harr = Instance.new("Hat", plr)
    harr.AttachmentPos = Vector3.new(0.009, -0.2, -0.01)
    local haandl = Instance.new("Part", harr)
    haandl.Name = "Handle"
    haandl.Size = Vector3.new(1.42, 0.95, 1.8)
    haandl.CanCollide = false
    haandl.Anchored = false
    haandl.Position = Vector3.new(7.331, 5.096, -44.221)
    haandl.Rotation = Vector3.new(-15.504, 14.478, 3.967)
    local meesh = Instance.new("SpecialMesh", haandl)
    meesh.MeshId = "rbxassetid://13030731"
    meesh.TextureId = "rbxassetid://13699943

this is the portion of the script that involves the hat I need rotated. Everything else works fine. Thank you

1 answer

Log in to vote
-1
Answered by
IcyEvil 260 Moderation Voter
8 years ago

You need a while loop, and it is obvious you know what it is, so I will update the script.

local harr = Instance.new("Hat", plr)
harr.AttachmentPos = Vector3.new(0.009, -0.2, -0.01)
local haandl = Instance.new("Part", harr)
haandl.Name = "Handle"
haandl.Size = Vector3.new(1.42, 0.95, 1.8)
haandl.CanCollide = false
haandl.Anchored = false
while wait() do
haandl.Position = Vector3.new(7.331, 5.096, -44.221)
haandl.Rotation = Vector3.new(-15.504, 14.478, 3.967)
end
local meesh = Instance.new("SpecialMesh", haandl)
meesh.MeshId = "rbxassetid://13030731"
meesh.TextureId = "rbxassetid://13699943

Any-how, you are probably going to need to edit the script a twinge.

0
I attempted the wait script but it ended up removing the hat from my character's head and made it's cancollide property false. King_Lua 20 — 8y
Ad

Answer this question