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

How would I go about moving an entire model after another script is triggered?

Asked by 4 years ago

It's sort of hard to explain, but I want to make one of those things that when you pull down on the trapped door, a ladder extends outwards for you to go into the attic. I have it to where if you press 'F' the trapdoor comes down, but I can't figure out how to make the second part extend like a ladder. I know it isn't much of a script, but I was wondering why this wasn't working. I tried to make it see when the main part is already rotated (after the trapped door opens) and then run a piece of the script to make the ladder come down.

local ladder = script.Parent
if script.Parent.MainPart.Position = Vector3.new(39.778,7.378,-12.766) then
    wait(.5)
    for i = 0,1,.001 do
        ladder:SetPrimaryPartCFrame(ladder:GetPrimaryPartCFrame() * CFrame.new(0,0,-i))
        wait()
end

Thanks!

0
??? iuclds 720 — 4y
0
Sorry, I'm not the best at explaining. I may be doing this way too complicated than it should be done, but I made a basic CFrame script to open a door when you press E. There's a ladder connected to it that i want to extend after the player opens the door. Let me know if you have further questions ccadeiscute -3 — 4y

1 answer

Log in to vote
0
Answered by
EDLLT 146
4 years ago

Not enough information but here.

local ladder = script.Parent
if script.Parent.MainPart.Position = Vector3.new(39.778,7.378,-12.766) then
    wait(.5)
    for i = 0,1,100/10000 do
        ladder:SetPrimaryPartCFrame(ladder:GetPrimaryPartCFrame() * CFrame.new(0,0,-i))
        wait()
end
0
Sorry, I'm not the best at explaining. I may be doing this way too complicated than it should be done, but I made a basic CFrame script to open a door when you press E. There's a ladder connected to it that i want to extend after the player opens the door. Let me know if you have further questions ccadeiscute -3 — 4y
Ad

Answer this question