This function is not returning the camera type to the player after the button is pressed.
local function returnPlayerToHumanoid(CamType)
CC.CameraType = CamType
end
CloseCameras.MouseButton1Click:Connect(function()
Frame.Visible = false
returnPlayerToHumanoid(Enum.CameraType.Custom)
print("Function finished") -- This prints successfully always.
end)
local function returnPlayerToHumanoid(CamType:Enum.CameraType):()
CC.CameraType = CamType
end
CloseCameras.MouseButton1Click:Connect(function():()
Frame.Visible = false
returnPlayerToHumanoid(Enum.CameraType.Custom)
print("Function finished") -- This prints successfully always.
end)