Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Door opening on command?

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

✓ Accepted answer
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

This discussion is preserved as it was. New answers, comments, and votes are closed.