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

How to raise a model?

Asked by 9 years ago

Hello,

I've tried to raise a part up and down, and it works, but I can't seem to do the same with a model?

Here is my script:

p1=game.Workspace.Balloon
repeat
for q=1,4 do
    p1.CFrame=CFrame.new(-127.4, q, 150.7)
    wait(.12)
end

for a=1,4 do
    p1.CFrame=p1.CFrame+Vector3.new(0,-1,0)
    wait(.06)
end
wait(.05)
until 1+1 ~= 2

What can I do to make it raise a model?

3 answers

Log in to vote
2
Answered by 9 years ago

You will need to set the PrimaryPart property of the model and then you can edit its CFrame. The rest of the model will move along with the Primary Part.

p1 = game.Workspace.Balloon -- The Model
p1.PrimaryPart = p1:FindFirstChild("Part") -- Set the PrimaryPart here
repeat
for q=1,4 do
    p1:SetPrimaryPartCFrame = CFrame.new(-127.4, q, 150.7) -- Set the Primary Part CFrame
    wait(.12)
end

for a=1,4 do
        p1:SetPrimaryPartCFrame = p1.CFrame+Vector3.new(0,-1,0)
        wait(.06)
end
wait(.05)
until 1+1 ~= 2
Ad
Log in to vote
1
Answered by 9 years ago

MoveTo function.

game.Workspace.ModelName:MoveTo(CFRAME)
Log in to vote
1
Answered by 9 years ago

game.Workspace.PartName.Position = game.Workspace.PartName.Position + Vector3.new(0, 5, 0)

Answer this question