Hello! I have a little problem… You see, there is this door I have and I want it to be a part of my main menu. For example, If you press “play” the door opens, and the camera zooms goes inside the door.
Here is my problem. I want the door to open and then the camera will zoom inside perfectly timed. But, I have no idea how to do this. I do know that I need to activate this function in order for the door to open.
Here is the function I need to activate to get the door open.
local function Open()
script.Parent.LockShowOne.BrickColor = BrickColor.new("Deep orange")
script.Parent.LockShow.BrickColor = BrickColor.new("Deep orange")
script.Parent.Frame.Union.Hydraulics:Play()
TweenModelH(script.Parent.Hydraulics1,CFrame.new(script.Parent.Hydraulics1.Union.Position.X - 4,script.Parent.Hydraulics1.Union.Position.Y,script.Parent.Hydraulics1.Union.Position.Z),false)
TweenModelH(script.Parent.Hydraulics2,CFrame.new(script.Parent.Hydraulics2.Union.Position.X + 4,script.Parent.Hydraulics2.Union.Position.Y,script.Parent.Hydraulics2.Union.Position.Z),true)
script.Parent.Frame.Union.Sound:Play()
TweenModel(script.Parent.Door,CFrame.new(script.Parent.Door.Center.Position.X,script.Parent.Door.Center.Position.Y + 8.4,script.Parent.Door.Center.Position.Z),true)
DoorStatus = "Opened"
script.Parent.LockShowOne.BrickColor = BrickColor.new("Bright green")
script.Parent.LockShow.BrickColor = BrickColor.new("Bright green")
end
Here’s the local script for the ScreenGui button
local tweenService = game:GetService("TweenService")
local btn = script.Parent
function tweenCamera(pos,tweenTime)
tweenService:Create(camera,TweenInfo.new(tweenTime,Enum.EasingStyle.Circular),{CFrame = pos.CFrame}):Play()
end
btn.MouseButton1Click:Connect(function()
btn.Visible = false
wait(5)
game:GetService("TeleportService"):Teleport("")
tweenCamera(mainMenuMap.CameraPart1,1)
wait(1)
print("Reached Destination")
end)
Thanks!
- AstralApples