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

How would I go on about to merge these two small scripts?

Asked by 6 years ago

I am trying to make it so that the model always remains at the CFrame my lower torso is at, while having it rotate at the same time. Please tell me how I can merge these two scripts, as I've tried myself without much luck.

CFrame position script:

local FA = game.ServerStorage.FireAura:Clone()
FA.Parent = workspace
FA.PrimaryPart = FA.Primary


while true do
    wait()
        FA:SetPrimaryPartCFrame(Player.Character.LowerTorso.CFrame)


end

Rotation script:

FA = workspace.FireAura
FA.PrimaryPart = FA.Primary

while true do
    script.Parent:SetPrimaryPartCFrame(script.Parent.Primary.CFrame * CFrame.fromEulerAnglesXYZ(0,0.1,0))
    wait()

end

Thank you.

1 answer

Log in to vote
0
Answered by 6 years ago

Have you tried this? :

local FA = game.ServerStorage.FireAura:Clone()
FA.Parent = workspace
FA.PrimaryPart = FA.Primary


while true do
    wait()
        FA:SetPrimaryPartCFrame(Player.Character.LowerTorso.CFrame)
    script.Parent:SetPrimaryPartCFrame(script.Parent.Primary.CFrame * CFrame.fromEulerAnglesXYZ(0,0.1,0))
end

although I'm not sure what the rotation script's parent is so it might not work.

Ad

Answer this question