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

Door opening on command?

Asked by
F_lipe 135
9 years ago

I did not plan for this to work the first time and I thought right.

This is what I have:

local function Open(msg)
    local Player = script.Parent.Parent
    if Player.Name == "AnonymousPain" then
    if msg == "Enable Lobby" then
    game.Workspace.Door.CFrame = CFrame.new(0, .1, 0)
    wait(.1)
    game.Workspace.Door.CFrame = CFrame.new(0, .1, 0)
    repeat until
    game.Workspace.Door.Position == Vector3(20.715, 45, 373.685)


end     
 end
  end

script.Parent.Chatted:connect(Open)

I believe my error is the repeat until... statement.

If you can help me thanks.

1 answer

Log in to vote
1
Answered by
Validark 1580 Snack Break Moderation Voter
9 years ago
for i=1,420 do --It will require some math, but it works.
game.Workspace.Door.CFrame = game.Workspace.Door.CFrame+CFrame.new(0, .1, 0)
end
Ad

Answer this question