So I am creating a camera that sets the players camera to a part.
The issue is that it is not doing it, but the rest of the script runs fine.
Another issue is that I added a wait so the script has time to find the camera, and the script does not yield and wait 3 seconds, it just ignores it.
game.Players.PlayerAdded:Connect(function(player)
print("Missile event has began")
wait(3)
local currentCamera = workspace.CurrentCamera
local camera = script.Parent:WaitForChild("Camera")
currentCamera.CameraType = Enum.CameraType.Scriptable
currentCamera.CameraSubject = camera
currentCamera.CFrame = camera.CFrame
print("Camera set to position")
script.BackgroundMusic:Play()
local messageGui = player:WaitForChild("PlayerGui"):WaitForChild("Message")
local displayMessage = messageGui:WaitForChild("MessageToDisplay")
local message1 = "Multiple hostile missiles have been spotted, please activate appropriate proticols"
local message2 = "C-RAM have failed to destroy the missiles, please prepare for impact"
local function typewriteMessage(message)
for i = 1, #message, 1 do
displayMessage.Text = string.sub(message, 1 ,i)
wait()
end
end
wait(0.5)
typewriteMessage(message1)
wait(10)
typewriteMessage(message2)
wait(2.5)
displayMessage.Text = ""
end)