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

How do I make it change the camera position to normal once the play button is played?

Asked by 4 years ago

When you press the play button, it changes to the normal camera mode, How do i do it?

code:

01local player = game.Players.LocalPlayer
02local character = player.CharacterAdded
03local Mouse = player:GetMouse()
04local camera = game.Workspace.CurrentCamera
05local frame = script.Parent.Frame
06local defaultCframe = camera.CFrame
07local view = 150
08local blur = game.Lighting.Blur
09blur.Size = 12
10 
11if
12    frame.Visible == true
13then
14    frame.IntroSound:Play()
15end
View all 37 lines...

1 answer

Log in to vote
0
Answered by
drcelt -3
4 years ago

This code is from my menu script: (make sure this is a local script) This is what shows the camera:

01local player = game.Players.LocalPlayer
02local character = player.CharacterAdded
03local mouse = player:GetMouse()
04local camera = game.Workspace.CurrentCamera
05local lighting = game.Lighting
06local defaultcframe = camera.CFrame
07local view = 150   
08local menucam = workspace.Scripts.MenuCam
09 
10script.Parent.Enabled = true
11wait(0.2)
12 
13 
14function updateCam()
15    camera.CFrame = menucam.CFrame
16end
17 
18 
19game:GetService("RunService").RenderStepped:Connect(updateCam)

This is what deletes the camera part and puts it back to normal, the players head:

01local player = game.Players.LocalPlayer
02local character = player.CharacterAdded
03local mouse = player:GetMouse()
04local camera = game.Workspace.CurrentCamera
05local lighting = game.Lighting
06local defaultcframe = camera.CFrame
07local view = 150   
08local menucam = workspace.Scripts.MenuCam
09 
10script.Parent.MouseButton1Click:Connect(function()
11    wait(0.2)
12    camera.CameraType = Enum.CameraType.Custom
13    script.Parent.Parent.Parent:Destroy()
14end)

Hopefully this helps

Ad

Answer this question